Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2009-02-11 18:48:57 +0000
committerJohn Arthorne2009-02-11 18:48:57 +0000
commit2d8d70c861f269d77bcb8270c580688f6bbd8d50 (patch)
treebce7344211ea79cd2fcf514c7060a1c0126aa839 /bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2
parent3178fed49d4fd3097a350284f4be10e660f769ed (diff)
downloadrt.equinox.p2-2d8d70c861f269d77bcb8270c580688f6bbd8d50.tar.gz
rt.equinox.p2-2d8d70c861f269d77bcb8270c580688f6bbd8d50.tar.xz
rt.equinox.p2-2d8d70c861f269d77bcb8270c580688f6bbd8d50.zip
Bug 264111 NPE in SimpleArtifactRepositoryFactory
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2')
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties1
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java9
4 files changed, 9 insertions, 6 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java
index 60e12f695..020228ba9 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/CompositeArtifactRepositoryFactory.java
@@ -43,9 +43,9 @@ public class CompositeArtifactRepositoryFactory extends ArtifactRepositoryFactor
boolean compress = true;
if (PROTOCOL_FILE.equals(location.getScheme())) {
local = true;
- localFile = new File(CompositeArtifactRepository.getActualLocation(location, true).getPath());
+ localFile = URIUtil.toFile(CompositeArtifactRepository.getActualLocation(location, true));
if (!localFile.exists()) {
- localFile = new File(CompositeArtifactRepository.getActualLocation(location, false).getPath());
+ localFile = URIUtil.toFile(CompositeArtifactRepository.getActualLocation(location, false));
compress = false;
}
} else {
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java
index d518b503f..f4eb22736 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/Messages.java
@@ -22,6 +22,7 @@ public class Messages extends NLS {
public static String io_failedRead;
public static String ecf_configuration_error;
public static String io_incompatibleVersion;
+ public static String io_invalidLocation;
public static String SignatureVerification_failedRead;
public static String SignatureVerification_invalidContent;
public static String SignatureVerification_invalidFileContent;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties
index 832a8c018..30333f5a3 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/messages.properties
@@ -19,6 +19,7 @@ io_parseError=\
ecf_configuration_error=Transport initialization error.
io_incompatibleVersion=\
Simple artifact repository has incompatible version {0}; expected {1}.
+io_invalidLocation=Invalid repository location: {0}
mirroring=Mirroring:
repoFailedWrite=Unable to write to repository: {0}.
diff --git a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
index 672549529..49d3c43ef 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.repository/src/org/eclipse/equinox/internal/p2/artifact/repository/simple/SimpleArtifactRepository.java
@@ -20,7 +20,8 @@ import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.equinox.internal.p2.artifact.processors.md5.MD5Verifier;
import org.eclipse.equinox.internal.p2.artifact.repository.*;
import org.eclipse.equinox.internal.p2.artifact.repository.Messages;
-import org.eclipse.equinox.internal.p2.core.helpers.*;
+import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
+import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.*;
import org.eclipse.equinox.internal.provisional.p2.artifact.repository.processing.*;
import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException;
@@ -217,11 +218,11 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
}
}
- public static URI getActualLocation(URI base, boolean compress) {
+ public static URI getActualLocation(URI base, boolean compress) throws IOException {
return getActualLocation(base, compress ? JAR_EXTENSION : XML_EXTENSION);
}
- private static URI getActualLocation(URI base, String extension) {
+ private static URI getActualLocation(URI base, String extension) throws IOException {
final String name = CONTENT_FILENAME + extension;
String spec = base.toString();
if (spec.endsWith(name))
@@ -233,7 +234,7 @@ public class SimpleArtifactRepository extends AbstractArtifactRepository impleme
try {
return new URI(spec);
} catch (URISyntaxException e) {
- return null;
+ throw new IOException(NLS.bind(Messages.io_invalidLocation, spec));
}
}

Back to the top