Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDejan Gloszic2006-04-25 18:41:36 +0000
committerDejan Gloszic2006-04-25 18:41:36 +0000
commit88c9fd188d816d1d30f6b3cd793e8d5785fd9b8f (patch)
tree9332657ef5b9e76e348099269fdc64ccb12fb837 /org.eclipse.ui.intro.universal
parentccfb3bdc9dac06f9c6931c45ab0dd901ad019aaa (diff)
downloadeclipse.platform.ua-88c9fd188d816d1d30f6b3cd793e8d5785fd9b8f.tar.gz
eclipse.platform.ua-88c9fd188d816d1d30f6b3cd793e8d5785fd9b8f.tar.xz
eclipse.platform.ua-88c9fd188d816d1d30f6b3cd793e8d5785fd9b8f.zip
Diffstat (limited to 'org.eclipse.ui.intro.universal')
-rw-r--r--org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/BundleUtil.java29
1 files changed, 27 insertions, 2 deletions
diff --git a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/BundleUtil.java b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/BundleUtil.java
index e8f794489..bb7f564a5 100644
--- a/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/BundleUtil.java
+++ b/org.eclipse.ui.intro.universal/src/org/eclipse/ui/internal/intro/universal/util/BundleUtil.java
@@ -161,8 +161,11 @@ public class BundleUtil {
Log.warning(msg);
return resource;
}
+ /*
localLocation = FileLocator.toFileURL(localLocation);
return localLocation.toExternalForm();
+ */
+ return toExternalForm(localLocation);
} catch (Exception e) {
String msg = StringUtil.concat("Failed to load resource: ", //$NON-NLS-1$
resource, " from ", getBundleHeader(bundle, //$NON-NLS-1$
@@ -171,6 +174,25 @@ public class BundleUtil {
return resource;
}
}
+
+ private static String toExternalForm(URL localURL) {
+ try {
+ localURL = FileLocator.toFileURL(localURL);
+ String result = localURL.toExternalForm();
+ if (result.startsWith("file:/")) { //$NON-NLS-1$
+ if (result.startsWith("file:///")==false) { //$NON-NLS-1$
+ result = "file:///"+result.substring(6); //$NON-NLS-1$
+ }
+ }
+ return result;
+ }
+ catch (IOException e) {
+ String msg = "Failed to resolve URL: " //$NON-NLS-1$
+ + localURL.toString();
+ Log.error(msg, e);
+ return localURL.toString();
+ }
+ }
@@ -202,17 +224,20 @@ public class BundleUtil {
URL bundleLocation = bundle.getEntry(""); //$NON-NLS-1$
if (bundleLocation == null)
return null;
+ /*
bundleLocation = FileLocator.toFileURL(bundleLocation);
return bundleLocation.toExternalForm();
+ */
+ return toExternalForm(bundleLocation);
} catch (IllegalStateException e) {
Log.error("Failed to access bundle: " //$NON-NLS-1$
+ bundle.getSymbolicName(), e);
return null;
- } catch (IOException e) {
+ } /* catch (IOException e) {
Log.error("Failed to resolve URL path for bundle: " //$NON-NLS-1$
+ bundle.getSymbolicName(), e);
return null;
- }
+ } */
}
/**

Back to the top