*** empty log message ***
diff --git a/bundles/org.eclipse.core.boot/src/org/eclipse/core/internal/boot/InternalBootLoader.java b/bundles/org.eclipse.core.boot/src/org/eclipse/core/internal/boot/InternalBootLoader.java index 271c7b9..ae73668 100644 --- a/bundles/org.eclipse.core.boot/src/org/eclipse/core/internal/boot/InternalBootLoader.java +++ b/bundles/org.eclipse.core.boot/src/org/eclipse/core/internal/boot/InternalBootLoader.java
@@ -494,11 +494,12 @@ loadOptions(); // initialize eclipse URL handling - PlatformURLHandlerFactory.startup(baseLocation + File.separator + META_AREA); + String metaPath = baseLocation + File.separator + META_AREA; + PlatformURLHandlerFactory.startup(metaPath); PlatformURLBaseConnection.startup(getInstallURL()); // past this point we can use eclipse:/platform/ URLs // load platform configuration and consume configuration-related arguments (must call after URL handler initialization) - appArgs = PlatformConfiguration.startup(appArgs, pluginPathLocation/*R1.0 compatibility*/, applicationR10/*R1.0 compatibility*/); + appArgs = PlatformConfiguration.startup(appArgs, pluginPathLocation/*R1.0 compatibility*/, applicationR10/*R1.0 compatibility*/, metaPath); // create and configure platform class loader loader = configurePlatformLoader();
diff --git a/bundles/org.eclipse.core.boot/src/org/eclipse/core/internal/boot/PlatformConfiguration.java b/bundles/org.eclipse.core.boot/src/org/eclipse/core/internal/boot/PlatformConfiguration.java index 0471c94..44f7fff 100644 --- a/bundles/org.eclipse.core.boot/src/org/eclipse/core/internal/boot/PlatformConfiguration.java +++ b/bundles/org.eclipse.core.boot/src/org/eclipse/core/internal/boot/PlatformConfiguration.java
@@ -1208,8 +1208,9 @@ * or BootLoader.startup(...) method. Supported for R1.0 compatibility * @param r10apps application identifies as passed on the BootLoader.run(...) * method. Supported for R1.0 compatibility. + * @param metaPath path to the platform metadata area */ - static synchronized String[] startup(String[] cmdArgs, URL r10plugins, String r10app) throws Exception { + static synchronized String[] startup(String[] cmdArgs, URL r10plugins, String r10app, String metaPath) throws Exception { // if BootLoader was invoked directly (rather than via Main), it is possible // to have the plugin-path and application set in 2 ways: (1) via an explicit
diff --git a/bundles/org.eclipse.core.runtime/plugin.xml b/bundles/org.eclipse.core.runtime/plugin.xml index a9a4b59..b95206a 100644 --- a/bundles/org.eclipse.core.runtime/plugin.xml +++ b/bundles/org.eclipse.core.runtime/plugin.xml
@@ -12,7 +12,7 @@ </runtime> <requires> - <import plugin="org.apache.xerces"/> + <import plugin="org.apache.xerces" version="3.2.1" match="equivalent"/> </requires> <extension-point name="%applicationsName" id="applications"/>
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/plugins/PluginDescriptor.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/plugins/PluginDescriptor.java index 2905bb7..f05c09f 100644 --- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/plugins/PluginDescriptor.java +++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/internal/plugins/PluginDescriptor.java Binary files differ
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 6ecc099..cea891a 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
@@ -145,6 +145,8 @@ * @see Platform */ public static URL asLocalURL(URL url) throws IOException { + if (!url.getProtocol().equals(PlatformURLHandler.PROTOCOL)) + return url; URLConnection connection = url.openConnection(); if (!(connection instanceof PlatformURLConnection)) return url; @@ -775,6 +777,8 @@ * @see Platform */ public static 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();
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/IPluginDescriptor.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/IPluginDescriptor.java index e31efc2..01062a4 100644 --- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/IPluginDescriptor.java +++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/IPluginDescriptor.java
@@ -5,6 +5,7 @@ * All Rights Reserved. */ +import java.util.Map; import java.util.MissingResourceException; import java.util.ResourceBundle; import java.net.URL; @@ -254,4 +255,32 @@ * @see #getPlugin */ public boolean isPluginActivated(); +/** + * Returns a URL for the given path. Returns <code>null</code> if the URL + * could not be computed or created. + * + * @param file path relative to plug-in installation location + * @return a URL for the given path or <code>null</code> It is not + * necessary to perform a 'resolve' on this URL. + * + * @since 2.0 + */ +public URL find(IPath path); +/** + * Returns a URL for the given path. Returns <code>null</code> if the URL + * could not be computed or created. + * + * @param path file path relative to plug-in installation location + * @param override map of override substitution arguments to be used for + * any $arg$ path elements. The map keys correspond to the substitution + * arguments (eg. "$nl$" or "$os$"). The resulting + * values must be of type java.lang.String. If the map is <code>null</code>, + * or does not contain the required substitution argument, the default + * is used. + * @return a URL for the given path or <code>null</code>. It is not + * necessary to perform a 'resolve' on this URL. + * + * @since 2.0 + */ +public URL find(IPath path, Map override); }
diff --git a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Plugin.java b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Plugin.java index 779eec7..c401c4e 100644 --- a/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Plugin.java +++ b/bundles/org.eclipse.core.runtime/src/org/eclipse/core/runtime/Plugin.java
@@ -239,7 +239,7 @@ * @return a URL for the given path or <code>null</code> */ public final URL find(IPath path) { - return find(path, null); + return getDescriptor().find(path); } /** * Returns a URL for the given path. Returns <code>null</code> if the URL @@ -255,122 +255,8 @@ * @return a URL for the given path or <code>null</code> */ public final URL find(IPath path, Map override) { - URL install = getDescriptor().getInstallURL(); - String first = path.segment(0); - if (first.charAt(0) != '$') { - URL result = findInPlugin(install, path.toString()); - if (result != null) - return result; - return findInFragments(path.toString()); - } - IPath rest = path.removeFirstSegments(1); - if (first.equalsIgnoreCase("$nl$")) - return findNL(install, rest, override); - if (first.equalsIgnoreCase("$os$")) - return findOS(install, rest, override); - if (first.equalsIgnoreCase("$ws$")) - return findWS(install, rest, override); - if (first.equalsIgnoreCase("$files$")) - return null; - return null; + return getDescriptor().find(path,override); } - -private URL findOS(URL install, IPath path, Map override) { - String os = null; - if (override != null) - try { // check for override - os = (String) override.get("$os$"); - } catch (ClassCastException e) { - } - if (os == null) - os = BootLoader.getOS(); // use default - String filePath = "os/" + os + "/" + path.toString(); - URL result = findInPlugin(install, filePath); - if (result != null) - return result; - return findInFragments(filePath); -} - -private URL findWS(URL install, IPath path, Map override) { - String ws = null; - if (override != null) - try { // check for override - ws = (String) override.get("$ws$"); - } catch (ClassCastException e) { - } - if (ws == null) - ws = BootLoader.getWS(); // use default - String filePath = "ws/" + ws + "/" + path.toString(); - URL result = findInPlugin(install, filePath); - if (result != null) - return result; - return findInFragments(filePath); -} - -private URL findNL(URL install, IPath path, Map override) { - String nl = null; - if (override != null) - try { // check for override - nl = (String) override.get("$nl$"); - } catch (ClassCastException e) { - } - if (nl == null) - nl = BootLoader.getNL(); // use default - nl = nl.replace('_', '/'); - URL result = null; - boolean done = false; - - while (!done) { - String filePath = "nl/" + (nl.equals("") ? nl : nl + "/") + path.toString(); - result = findInPlugin(install, filePath); - if (result != null) - return result; - result = findInFragments(filePath); - if (result != null) - return result; - if (nl.length() == 0) - done = true; - else { - int i = nl.lastIndexOf('/'); - if (i < 0) - nl = ""; - else - nl = nl.substring(0, i); - } - } - return null; -} - -private URL findInPlugin(URL install, String filePath) { - try { - URL result = new URL(install, filePath); - URL location = Platform.resolve(result); - String file = getFileFromURL(location); - if (file != null && new File(file).exists()) - return result; - } catch (IOException e) { - } - return null; -} - -private URL findInFragments(String path) { - PluginFragmentModel[] fragments = ((PluginDescriptor)getDescriptor()).getFragments(); - if (fragments == null) - return null; - - for (int i = 0; i < fragments.length; i++) { - try { - URL location = new URL(fragments[i].getLocation() + path); - String file = getFileFromURL(location); - if (file != null && new File(file).exists()) - return location; - } catch (IOException e) { - // skip malformed url and urls that cannot be resolved - } - } - return null; -} - private String getFileFromURL(URL target) { String protocol = target.getProtocol(); if (protocol.equals(PlatformURLHandler.FILE))