diff options
author | Denis Lila <[email protected]> | 2011-03-04 18:16:07 -0500 |
---|---|---|
committer | Denis Lila <[email protected]> | 2011-03-04 18:16:07 -0500 |
commit | aeb8dbac97efe7dec9452a406c8b93e1eeef07cf (patch) | |
tree | f25962b7d21441f232a243d39e80a4c74423f58d | |
parent | ec6d0386718421e0c86a1c49feb3a227452da24b (diff) |
Fix PR658
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/JNLPFile.java | 28 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/PluginBridge.java | 23 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java | 20 |
5 files changed, 66 insertions, 19 deletions
@@ -1,5 +1,18 @@ 2011-03-04 Denis Lila <[email protected]> + * netx/net/sourceforge/jnlp/JNLPFile.java: + (getDownloadOptionsForJar): Moved here from JNLPClassLoader.java. + * netx/net/sourceforge/jnlp/PluginBridge.java + (usePack, useVersion): added. + (PluginBridge): initializing usePack and useVersion. + (getDownloadOptionsForJar): return the download options. + * netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java + (getDownloadOptionsForJar): logic moved to JNLPFile.java and its + subclasses. Now just calling file.getDownloadOptionsForJar. + * NEWS: Updated with fix of PR658. + +2011-03-04 Denis Lila <[email protected]> + * netx/net/sourceforge/jnlp/cache/ResourceTracker.java (downloadResource): changed the order in which pack200+gz compression and gzip compression are checked. @@ -20,6 +20,7 @@ New in release 1.1 (2011-XX-XX): * NetX - Use Firefox's proxy settings if possible - RH669942: javaws fails to download version/packed files (missing support for jnlp.packEnabled and jnlp.versionEnabled) + - PR658: now jnlp.packEnabled works with applets. * Plugin - PR475, RH604061: Allow applets from the same page to use the same classloader - PR612: NetDania application ends on java.security.AccessControlException: access denied (java.util.PropertyPermission browser read) diff --git a/netx/net/sourceforge/jnlp/JNLPFile.java b/netx/net/sourceforge/jnlp/JNLPFile.java index 1bee246..2596c47 100644 --- a/netx/net/sourceforge/jnlp/JNLPFile.java +++ b/netx/net/sourceforge/jnlp/JNLPFile.java @@ -645,4 +645,32 @@ public class JNLPFile { return newVMArgs; } + /** + * XXX: this method does a "==" comparison between the input JARDesc and + * jars it finds through getResourcesDescs(). If ever the implementation + * of that function should change to return copies of JARDescs objects, + * then the "jar == aJar" comparison below should change accordingly. + * @param jar: the jar whose download options to get. + * @return the download options. + */ + public DownloadOptions getDownloadOptionsForJar(JARDesc jar) { + boolean usePack = false; + boolean useVersion = false; + ResourcesDesc[] descs = getResourcesDescs(); + for (ResourcesDesc desc: descs) { + JARDesc[] jars = desc.getJARs(); + for (JARDesc aJar: jars) { + if (jar == aJar/*jar.getLocation().equals(aJar.getLocation())*/) { + if (Boolean.valueOf(desc.getPropertiesMap().get("jnlp.packEnabled"))) { + usePack = true; + } + if (Boolean.valueOf(desc.getPropertiesMap().get("jnlp.versionEnabled"))) { + useVersion = true; + } + } + } + } + return new DownloadOptions(usePack, useVersion); + } + } diff --git a/netx/net/sourceforge/jnlp/PluginBridge.java b/netx/net/sourceforge/jnlp/PluginBridge.java index a3ef9f3..b8f493a 100644 --- a/netx/net/sourceforge/jnlp/PluginBridge.java +++ b/netx/net/sourceforge/jnlp/PluginBridge.java @@ -40,6 +40,8 @@ public class PluginBridge extends JNLPFile { String[] cacheJars = new String[0]; String[] cacheExJars = new String[0]; Hashtable<String, String> atts; + private boolean usePack; + private boolean useVersion; public PluginBridge(URL codebase, URL documentBase, String jar, String main, int width, int height, Hashtable<String, String> atts) @@ -134,6 +136,27 @@ public class PluginBridge extends JNLPFile { // same page can communicate (there are applets known to require // such communication for proper functionality) this.uniqueKey = documentBase.toString(); + + usePack = false; + useVersion = false; + String jargs = atts.get("java_arguments"); + if (jargs != null) { + for (String s : jargs.split(" ")) { + String[] parts = s.trim().split("="); + if (parts.length == 2 && Boolean.valueOf(parts[1])) { + if ("-Djnlp.packEnabled".equals(parts[0])) { + usePack = true; + } else if ("-Djnlp.versionEnabled".equals(parts[0])) { + useVersion = true; + } + } + } + } + } + + @Override + public DownloadOptions getDownloadOptionsForJar(JARDesc jar) { + return new DownloadOptions(usePack, useVersion); } public String getTitle() { diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java index aae8b8b..6bebfc6 100644 --- a/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java +++ b/netx/net/sourceforge/jnlp/runtime/JNLPClassLoader.java @@ -1321,25 +1321,7 @@ public class JNLPClassLoader extends URLClassLoader { } private DownloadOptions getDownloadOptionsForJar(JARDesc jar) { - boolean usePack = false; - boolean useVersion = false; - - ResourcesDesc[] descs = file.getResourcesDescs(); - for (ResourcesDesc desc: descs) { - JARDesc[] jars = desc.getJARs(); - for (JARDesc aJar: jars) { - if (jar == aJar) { - if (Boolean.valueOf(desc.getPropertiesMap().get("jnlp.packEnabled"))) { - usePack = true; - } - if (Boolean.valueOf(desc.getPropertiesMap().get("jnlp.versionEnabled"))) { - useVersion = true; - } - } - } - } - - return new DownloadOptions(usePack, useVersion); + return file.getDownloadOptionsForJar(jar); } /* |