Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Niefer2009-02-20 12:05:06 -0500
committerAndrew Niefer2009-02-20 12:05:06 -0500
commit8104f051ada88383deb59d869121812f74c550af (patch)
tree7f21bedc1956199cf2d8d84ad44953704b03aece /bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse
parent0d0df278c184ad6888f3da8bac84ba02d3cde6bb (diff)
downloadrt.equinox.p2-8104f051ada88383deb59d869121812f74c550af.tar.gz
rt.equinox.p2-8104f051ada88383deb59d869121812f74c550af.tar.xz
rt.equinox.p2-8104f051ada88383deb59d869121812f74c550af.zip
bug 265523 - support jar:file: uris
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java15
1 files changed, 13 insertions, 2 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
index 19ce2f005..85304e2b5 100644
--- a/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
+++ b/bundles/org.eclipse.equinox.p2.repository.tools/src_ant/org/eclipse/equinox/p2/internal/repository/tools/tasks/AbstractRepositoryTask.java
@@ -12,6 +12,7 @@ package org.eclipse.equinox.p2.internal.repository.tools.tasks;
import java.io.File;
import java.net.URI;
+import java.net.URISyntaxException;
import java.util.*;
import org.apache.tools.ant.*;
import org.apache.tools.ant.types.FileSet;
@@ -121,7 +122,17 @@ public abstract class AbstractRepositoryTask extends Task {
String[][] elements = new String[][] {scanner.getIncludedDirectories(), scanner.getIncludedFiles()};
for (int i = 0; i < 2; i++) {
for (int j = 0; j < elements[i].length; j++) {
- URI uri = new File(fileset.getDir(), elements[i][j]).toURI();
+ File file = new File(fileset.getDir(), elements[i][j]);
+ URI uri = file.toURI();
+
+ if (file.isFile() && file.getName().endsWith(".zip")) { //$NON-NLS-1$
+ try {
+ uri = new URI("jar:" + uri.toString() + "!/"); //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (URISyntaxException e) {
+ //?
+ continue;
+ }
+ }
application.addSourceArtifactRepository(uri);
application.addSourceMetadataRepository(uri);
}
@@ -156,7 +167,7 @@ public abstract class AbstractRepositoryTask extends Task {
}
if (collector.isEmpty())
- throw new BuildException("Unable to find: " + id + (version != null ? " " + version : ""));
+ throw new BuildException("Unable to find: " + id + (version != null ? " " + version : "")); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
result.add(collector.iterator().next());
}
return result;

Back to the top