diff options
author | Andrew Su <[email protected]> | 2011-06-08 13:32:54 -0400 |
---|---|---|
committer | Andrew Su <[email protected]> | 2011-06-08 13:32:54 -0400 |
commit | 951ed82e0114529ca7160ca4da372adb89e99d69 (patch) | |
tree | 05bc8f09e5310d9d9823ecb3f318f412dd3563c6 /netx/net/sourceforge/jnlp/PluginBridge.java | |
parent | 5d7c7a2009f1ccdc91cc5038cfd79d3f51a4ca4a (diff) |
Enable passing applet parameters through JNLP files.
Diffstat (limited to 'netx/net/sourceforge/jnlp/PluginBridge.java')
-rw-r--r-- | netx/net/sourceforge/jnlp/PluginBridge.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/netx/net/sourceforge/jnlp/PluginBridge.java b/netx/net/sourceforge/jnlp/PluginBridge.java index 3423318..a54858a 100644 --- a/netx/net/sourceforge/jnlp/PluginBridge.java +++ b/netx/net/sourceforge/jnlp/PluginBridge.java @@ -53,17 +53,23 @@ public class PluginBridge extends JNLPFile { fileVersion = new Version("1.1"); this.codeBase = codebase; this.sourceLocation = documentBase; + this.atts = atts; if (atts.containsKey("jnlp_href")) { try { URL jnlp = new URL(codeBase.toExternalForm() + atts.get("jnlp_href")); - JNLPFile jnlpFile = new JNLPFile(jnlp); + JNLPFile jnlpFile = new JNLPFile(jnlp, null, false, JNLPRuntime.getDefaultUpdatePolicy(), this.codeBase); Map<String, String> jnlpParams = jnlpFile.getApplet().getParameters(); // Change the parameter name to lowercase to follow conventions. for (Map.Entry<String, String> entry : jnlpParams.entrySet()) { - atts.put(entry.getKey().toLowerCase(), entry.getValue()); + this.atts.put(entry.getKey().toLowerCase(), entry.getValue()); } + JARDesc[] jarDescs = jnlpFile.getResources().getJARs(); + for (JARDesc jarDesc : jarDescs) { + String fileName = jarDesc.getLocation().toExternalForm(); + this.jars.add(fileName); + } } catch (MalformedURLException e) { // Don't fail because we cannot get the jnlp file. Parameters are optional not required. // it is the site developer who should ensure that file exist. @@ -117,7 +123,6 @@ public class PluginBridge extends JNLPFile { System.err.println("jars length: " + jars.length); } } - this.atts = atts; name = atts.get("name"); if (name == null) |