diff options
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java b/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java index a6d8935a4e..bf1de817f7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/common_j2se/org/eclipse/swt/internal/Library.java @@ -171,19 +171,15 @@ static boolean isLoadable () { return true; } - try { - url = new URL (url.getPath ()); - } catch (MalformedURLException e) { - /* should never happen since url's initial path value must be valid */ - } - Attributes attributes = null; try { - String path = URLDecoder.decode(url.getPath (), "UTF-8"); - int index = path.indexOf ('!'); - File file = new File (path.substring (0, index)); - JarFile jar = new JarFile (file); - attributes = jar.getManifest ().getMainAttributes (); + URLConnection connection = url.openConnection(); + if (!(connection instanceof JarURLConnection)) { + /* should never happen for a "jar:" url */ + return false; + } + JarURLConnection jc = (JarURLConnection) connection; + attributes = jc.getMainAttributes(); } catch (IOException e) { /* should never happen for a valid SWT jar with the expected manifest values */ return false; |