diff options
author | Deepak Bhole <[email protected]> | 2011-09-28 15:28:14 -0400 |
---|---|---|
committer | Deepak Bhole <[email protected]> | 2011-09-28 15:28:14 -0400 |
commit | 7a339780a1b3af621e2887c8dc41d86273d62320 (patch) | |
tree | ba01f902312b6576d8171c43de732781b7ac5a52 /netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java | |
parent | dc63e62272f8d610986ce9327ce8ffdea9fe75f9 (diff) |
PR794: IcedTea-Web does not work if a Web Start app jar has a Class-Path
element in the manifest.
Diffstat (limited to 'netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java b/netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java index ca3f4be..48364df 100644 --- a/netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java +++ b/netx/net/sourceforge/jnlp/runtime/CachedJarFileCallback.java @@ -94,7 +94,24 @@ final class CachedJarFileCallback implements URLJarFileCallBack { if (UrlUtils.isLocalFile(localUrl)) { // if it is known to us, just return the cached file - return new JarFile(localUrl.getPath()); + JarFile returnFile = new JarFile(localUrl.getPath()); + + try { + + // Blank out the class-path because: + // 1) Web Start does not support it + // 2) For the plug-in, we want to cache files from class-path so we do it manually + returnFile.getManifest().getMainAttributes().putValue("Class-Path", ""); + + if (JNLPRuntime.isDebug()) { + System.err.println("Class-Path attribute cleared for " + returnFile.getName()); + } + + } catch (NullPointerException npe) { + // Discard NPE here. Maybe there was no manifest, maybe there were no attributes, etc. + } + + return returnFile; } else { // throw new IllegalStateException("a non-local file in cache"); return null; |