aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp/JNLPFile.java
diff options
context:
space:
mode:
authorAndrew Su <[email protected]>2011-06-08 13:32:54 -0400
committerAndrew Su <[email protected]>2011-06-08 13:32:54 -0400
commit951ed82e0114529ca7160ca4da372adb89e99d69 (patch)
tree05bc8f09e5310d9d9823ecb3f318f412dd3563c6 /netx/net/sourceforge/jnlp/JNLPFile.java
parent5d7c7a2009f1ccdc91cc5038cfd79d3f51a4ca4a (diff)
Enable passing applet parameters through JNLP files.
Diffstat (limited to 'netx/net/sourceforge/jnlp/JNLPFile.java')
-rw-r--r--netx/net/sourceforge/jnlp/JNLPFile.java24
1 files changed, 20 insertions, 4 deletions
diff --git a/netx/net/sourceforge/jnlp/JNLPFile.java b/netx/net/sourceforge/jnlp/JNLPFile.java
index 9add91b..183f6b1 100644
--- a/netx/net/sourceforge/jnlp/JNLPFile.java
+++ b/netx/net/sourceforge/jnlp/JNLPFile.java
@@ -174,8 +174,24 @@ public class JNLPFile {
* @throws ParseException if the JNLP file was invalid
*/
public JNLPFile(URL location, Version version, boolean strict, UpdatePolicy policy) throws IOException, ParseException {
+ this(location, version, strict, policy, null);
+ }
+
+ /**
+ * Create a JNLPFile from a URL and a version, checking for updates
+ * using the specified policy.
+ *
+ * @param location the location of the JNLP file
+ * @param version the version of the JNLP file
+ * @param strict whether to enforce the spec when
+ * @param policy the update policy
+ * @param forceCodebase codebase to use if not specified in JNLP file.
+ * @throws IOException if an IO exception occurred
+ * @throws ParseException if the JNLP file was invalid
+ */
+ protected JNLPFile(URL location, Version version, boolean strict, UpdatePolicy policy, URL forceCodebase) throws IOException, ParseException {
Node root = Parser.getRootNode(openURL(location, version, policy));
- parse(root, strict, location);
+ parse(root, strict, location, forceCodebase);
//Downloads the original jnlp file into the cache if possible
//(i.e. If the jnlp file being launched exist locally, but it
@@ -222,7 +238,7 @@ public class JNLPFile {
* @throws ParseException if the JNLP file was invalid
*/
public JNLPFile(InputStream input, boolean strict) throws ParseException {
- parse(Parser.getRootNode(input), strict, null);
+ parse(Parser.getRootNode(input), strict, null, null);
}
/**
@@ -574,12 +590,12 @@ public class JNLPFile {
* @param strict whether to enforce the spec when
* @param location the file location or null
*/
- private void parse(Node root, boolean strict, URL location) throws ParseException {
+ private void parse(Node root, boolean strict, URL location, URL forceCodebase) throws ParseException {
try {
//if (location != null)
// location = new URL(location, "."); // remove filename
- Parser parser = new Parser(this, location, root, strict, true); // true == allow extensions
+ Parser parser = new Parser(this, location, root, strict, true, forceCodebase); // true == allow extensions
// JNLP tag information
specVersion = parser.getSpecVersion();