aboutsummaryrefslogtreecommitdiffstats
path: root/netx/net/sourceforge/jnlp
diff options
context:
space:
mode:
authordlila <devnull@localhost>2011-03-25 14:23:28 -0400
committerdlila <devnull@localhost>2011-03-25 14:23:28 -0400
commit46f73ee707976028a9e9bfb4f96138d704b31185 (patch)
treea3b29503f13e06b7178b8a7575fe46b588e462b8 /netx/net/sourceforge/jnlp
parent7d6ec16b33a835571fbce609c0611733e620055f (diff)
Implement codebase_lookup=false.
Diffstat (limited to 'netx/net/sourceforge/jnlp')
-rw-r--r--netx/net/sourceforge/jnlp/Launcher.java12
-rw-r--r--netx/net/sourceforge/jnlp/PluginBridge.java8
2 files changed, 16 insertions, 4 deletions
diff --git a/netx/net/sourceforge/jnlp/Launcher.java b/netx/net/sourceforge/jnlp/Launcher.java
index 09212b8..531e282 100644
--- a/netx/net/sourceforge/jnlp/Launcher.java
+++ b/netx/net/sourceforge/jnlp/Launcher.java
@@ -563,8 +563,11 @@ public class Launcher {
try {
JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy);
- if (enableCodeBase || file.getResources().getJARs().length == 0)
+ if (enableCodeBase) {
loader.enableCodeBase();
+ } else if (file.getResources().getJARs().length == 0) {
+ throw new ClassNotFoundException("Can't do a codebase look up and there are no jars. Failing sooner rather than later");
+ }
AppThreadGroup group = (AppThreadGroup) Thread.currentThread().getThreadGroup();
@@ -603,8 +606,11 @@ public class Launcher {
try {
JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy);
- if (enableCodeBase || file.getResources().getJARs().length == 0)
+ if (enableCodeBase) {
loader.enableCodeBase();
+ } else if (file.getResources().getJARs().length == 0) {
+ throw new ClassNotFoundException("Can't do a codebase look up and there are no jars. Failing sooner rather than later");
+ }
String appletName = file.getApplet().getMainClass();
@@ -742,7 +748,7 @@ public class Launcher {
if (isPlugin) {
// Do not display download indicators if we're using gcjwebplugin.
JNLPRuntime.setDefaultDownloadIndicator(null);
- application = getApplet(file, true, cont);
+ application = getApplet(file, ((PluginBridge)file).codeBaseLookup(), cont);
} else {
if (file.isApplication())
application = launchApplication(file);
diff --git a/netx/net/sourceforge/jnlp/PluginBridge.java b/netx/net/sourceforge/jnlp/PluginBridge.java
index 942630b..db006af 100644
--- a/netx/net/sourceforge/jnlp/PluginBridge.java
+++ b/netx/net/sourceforge/jnlp/PluginBridge.java
@@ -24,7 +24,6 @@ package net.sourceforge.jnlp;
import java.net.URL;
import java.net.MalformedURLException;
-import java.util.Calendar;
import java.util.Hashtable;
import java.util.Locale;
import java.util.List;
@@ -42,6 +41,7 @@ public class PluginBridge extends JNLPFile {
Hashtable<String, String> atts;
private boolean usePack;
private boolean useVersion;
+ private boolean codeBaseLookup;
public PluginBridge(URL codebase, URL documentBase, String jar, String main,
int width, int height, Hashtable<String, String> atts)
@@ -152,6 +152,12 @@ public class PluginBridge extends JNLPFile {
}
}
}
+ String cbl = atts.get("codebase_lookup");
+ codeBaseLookup = cbl == null || (Boolean.valueOf(cbl));
+ }
+
+ public boolean codeBaseLookup() {
+ return codeBaseLookup;
}
/**