diff options
author | John Arthorne | 2010-01-22 22:30:40 +0000 |
---|---|---|
committer | John Arthorne | 2010-01-22 22:30:40 +0000 |
commit | a99e378587d01c340f2d2951b7fccd6bd4bd1518 (patch) | |
tree | 8cdbe97d92bb3b7ff8cebcfb6e642d41cc9d2e15 /bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox | |
parent | eeefc19f85c23b455d38093edfd06bde2319d9f4 (diff) | |
download | rt.equinox.p2-a99e378587d01c340f2d2951b7fccd6bd4bd1518.tar.gz rt.equinox.p2-a99e378587d01c340f2d2951b7fccd6bd4bd1518.tar.xz rt.equinox.p2-a99e378587d01c340f2d2951b7fccd6bd4bd1518.zip |
Bug 296066 - Creating Agent with file path
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox')
-rw-r--r-- | bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java index 45f8a9d66..bb304a528 100644 --- a/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java +++ b/bundles/org.eclipse.equinox.p2.core/src/org/eclipse/equinox/internal/p2/core/Activator.java @@ -11,8 +11,7 @@ package org.eclipse.equinox.internal.p2.core; import java.io.File; -import java.net.URI; -import java.net.URISyntaxException; +import java.net.*; import java.util.Dictionary; import java.util.Hashtable; import org.eclipse.core.runtime.Path; @@ -76,8 +75,11 @@ public class Activator implements BundleActivator { try { if (isFile) return adjustTrailingSlash(new File(spec.substring(5)).toURI(), trailingSlash); + //for compatibility only allow non-file URI if it is also a legal URL + //when given "c:/foo" we want to treat it as a file rather than a URI with protocol "c" + new URL(spec); return new URI(spec); - } catch (URISyntaxException e) { + } catch (Exception e) { // if we failed and it is a file spec, there is nothing more we can do // otherwise, try to make the spec into a file URL. if (isFile) |