diff options
author | Sven Gothel <[email protected]> | 2011-09-17 19:46:05 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2011-09-17 19:46:05 +0200 |
commit | 393505121da3040029339d2a3cabcd894282499b (patch) | |
tree | 89ce99dee9aa2f0d2e9a90e4f72d7fbe21fce37c /src/org/jdesktop/applet/util/JNLPAppletLauncher.java | |
parent | c6720ef3ed6082161d8b24769f1e691513714e2f (diff) |
Allow jnlpExtension to be relative from document-base
Diffstat (limited to 'src/org/jdesktop/applet/util/JNLPAppletLauncher.java')
-rw-r--r-- | src/org/jdesktop/applet/util/JNLPAppletLauncher.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/org/jdesktop/applet/util/JNLPAppletLauncher.java b/src/org/jdesktop/applet/util/JNLPAppletLauncher.java index 1c21f8d..44f5e2b 100644 --- a/src/org/jdesktop/applet/util/JNLPAppletLauncher.java +++ b/src/org/jdesktop/applet/util/JNLPAppletLauncher.java @@ -64,6 +64,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.lang.reflect.Method; +import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.nio.channels.FileChannel; @@ -1372,7 +1373,14 @@ public class JNLPAppletLauncher extends Applet { if (urlString == null || urlString.length() == 0) { throw new IllegalArgumentException("Missing " + paramName + " parameter"); } - URL url = new URL(urlString); + URL url = null; + try { + // just try if user provided string contains protocol + url = new URL(urlString); + } catch (MalformedURLException mue) { + // assume relative URL to documentbase + url = new URL(getDocumentBase(), urlString); + } urls.add(url); } |