diff options
Diffstat (limited to 'netx')
-rw-r--r-- | netx/net/sourceforge/jnlp/Launcher.java | 12 | ||||
-rw-r--r-- | netx/net/sourceforge/jnlp/PluginBridge.java | 8 |
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; } /** |