From 393505121da3040029339d2a3cabcd894282499b Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Sat, 17 Sep 2011 19:46:05 +0200 Subject: Allow jnlpExtension to be relative from document-base --- src/org/jdesktop/applet/util/JNLPAppletLauncher.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.3