Change Platform.resolve() back to return file or jar URLs.
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
index 8c44d31..5f10135 100644
--- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
+++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/runtime/InternalPlatform.java
@@ -207,7 +207,7 @@
// If this is a platform URL get the local URL from the PlatformURLConnection
if (result.getProtocol().equals(PlatformURLHandler.PROTOCOL)){
- result = resolve(url);
+ result = asActualURL(url);
}
// If the result is a bundleentry or bundleresouce URL then
@@ -223,6 +223,17 @@
return result;
}
+
+ private URL asActualURL(URL url) throws IOException {
+ if (!url.getProtocol().equals(PlatformURLHandler.PROTOCOL))
+ return url;
+ URLConnection connection = url.openConnection();
+ if (connection instanceof PlatformURLConnection)
+ return ((PlatformURLConnection) connection).getResolvedURL();
+ else
+ return url;
+ }
+
private void assertInitialized() {
//avoid the Policy.bind if assertion is true
if (!initialized)
@@ -813,13 +824,17 @@
* @see Platform
*/
public URL resolve(URL url) throws IOException {
- if (!url.getProtocol().equals(PlatformURLHandler.PROTOCOL))
- return url;
- URLConnection connection = url.openConnection();
- if (connection instanceof PlatformURLConnection)
- return ((PlatformURLConnection) connection).getResolvedURL();
- else
- return url;
+ URL result = asActualURL(url);
+ if (!result.getProtocol().startsWith(PlatformURLHandler.BUNDLE))
+ return result;
+
+ URLConverter urlConverter = getURLConverter();
+ if (urlConverter == null) {
+ throw new IOException("url.noaccess");
+ }
+ result = urlConverter.convertToLocalURL(result);
+
+ return result;
}
public void run(ISafeRunnable code) {
Assert.isNotNull(code);