Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2009-03-28 17:01:51 +0000
committerPascal Rapicault2009-03-28 17:01:51 +0000
commit9f18452821b4adbfc557c2aac1722f80688b054d (patch)
tree739796bc08210eefe366f5d9e7c7a83bff498b28 /bundles/org.eclipse.equinox.p2.installer
parent03e64b3582aab73563f08b63b38d217dfa148bde (diff)
downloadrt.equinox.p2-9f18452821b4adbfc557c2aac1722f80688b054d.tar.gz
rt.equinox.p2-9f18452821b4adbfc557c2aac1722f80688b054d.tar.xz
rt.equinox.p2-9f18452821b4adbfc557c2aac1722f80688b054d.zip
Fix NPE on the mac and make the base always match install location
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.installer')
-rw-r--r--bundles/org.eclipse.equinox.p2.installer/src/org/eclipse/equinox/internal/p2/installer/InstallDescriptionParser.java19
1 files changed, 11 insertions, 8 deletions
diff --git a/bundles/org.eclipse.equinox.p2.installer/src/org/eclipse/equinox/internal/p2/installer/InstallDescriptionParser.java b/bundles/org.eclipse.equinox.p2.installer/src/org/eclipse/equinox/internal/p2/installer/InstallDescriptionParser.java
index eef9d1393..6cbea46f7 100644
--- a/bundles/org.eclipse.equinox.p2.installer/src/org/eclipse/equinox/internal/p2/installer/InstallDescriptionParser.java
+++ b/bundles/org.eclipse.equinox.p2.installer/src/org/eclipse/equinox/internal/p2/installer/InstallDescriptionParser.java
@@ -48,14 +48,17 @@ public class InstallDescriptionParser {
URI propsURI = URIUtil.fromString(site);
InputStream in = null;
if (!propsURI.isAbsolute()) {
- File file = new File(site).getAbsoluteFile();
- if (file.exists()) {
- propsURI = file.toURI();
- in = new FileInputStream(file);
- } else
- propsURI = null;
- } else
- in = propsURI.toURL().openStream();
+ String installerInstallArea = System.getProperty("osgi.install.area");
+ if (installerInstallArea == null)
+ throw new IllegalStateException("Install area is not specified.");
+
+ propsURI = URIUtil.append(URIUtil.fromString(installerInstallArea), site);
+ File installerDescription = URIUtil.toFile(propsURI);
+ if (!installerDescription.exists()) {
+ throw new IllegalStateException("Can't find install description file: " + installerDescription);
+ }
+ }
+ in = propsURI.toURL().openStream();
Properties properties = new Properties();
try {

Back to the top