aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Su <[email protected]>2010-10-20 10:17:46 -0400
committerAndrew Su <[email protected]>2010-10-20 10:17:46 -0400
commitc8dbedda7fc8b6689fc793f1bb06acb8af17e412 (patch)
treee9b1909b353f69912605ab4a1a36f0025ee1d846
parentd126f775be1fae93682924fae7ce39034255a063 (diff)
Enabled parsing jnlp file located at jnlp_href for applet parameters.
-rw-r--r--ChangeLog6
-rw-r--r--netx/net/sourceforge/jnlp/PluginBridge.java22
2 files changed, 28 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 5e6f276..6428c5e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-10-20 Andrew Su <[email protected]>
+
+ * PluginBridge.java:
+ (PluginBridge): Added parsing for jnlp_href, and reading the jnlp file
+ for applet parameters.
+
2010-10-20 Matthias Klose <[email protected]>
* Makefile.am (stamps/extra-class-files.stamp): Fix -sourcepath.
diff --git a/netx/net/sourceforge/jnlp/PluginBridge.java b/netx/net/sourceforge/jnlp/PluginBridge.java
index 4ae100a..9c847e5 100644
--- a/netx/net/sourceforge/jnlp/PluginBridge.java
+++ b/netx/net/sourceforge/jnlp/PluginBridge.java
@@ -26,9 +26,11 @@ import java.net.URL;
import java.net.MalformedURLException;
import java.util.Calendar;
import java.util.Hashtable;
+import java.util.Iterator;
import java.util.Locale;
import java.util.List;
import java.util.ArrayList;
+import java.util.Map;
import net.sourceforge.jnlp.runtime.JNLPRuntime;
@@ -50,6 +52,26 @@ public class PluginBridge extends JNLPFile
fileVersion = new Version("1.1");
this.codeBase = codebase;
this.sourceLocation = documentBase;
+
+ if (atts.containsKey("jnlp_href")){
+ try {
+ URL jnlp = new URL(codeBase.toExternalForm() + (String) atts.get("jnlp_href"));
+ JNLPFile jnlp_file = new JNLPFile(jnlp);
+ Map jnlp_params = jnlp_file.getApplet().getParameters();
+
+ // Change the parameter name to lowercase to follow conventions.
+ Iterator it = jnlp_params.keySet().iterator();
+ while(it.hasNext()){
+ String key = (String) it.next();
+ atts.put(key.toLowerCase(), jnlp_params.get(key));
+ }
+ } 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.
+ System.err.println("Unable to get JNLP file at: " + codeBase.toExternalForm()
+ + (String) atts.get("jnlp_href"));
+ }
+ }
// also, see if cache_archive is specified
if (atts.get("cache_archive") != null && ((String) atts.get("cache_archive")).length() > 0) {