X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Futil%2FPlatform.java;h=96940e5352d80c67dbd6435afe0c282a21ace5b3;hb=08873667c3fbbf2b925c7b6ac12950f6da102e17;hp=66ce5568dd2ba3b77b62894920a1d1fcd0405cfd;hpb=b2f46d3180dc0bf7cdc75f1c87ebf9dc866d4be8;p=jalview.git diff --git a/src/jalview/util/Platform.java b/src/jalview/util/Platform.java index 66ce556..96940e5 100644 --- a/src/jalview/util/Platform.java +++ b/src/jalview/util/Platform.java @@ -32,6 +32,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; +import java.net.MalformedURLException; import java.net.URL; import java.util.Properties; @@ -458,7 +459,7 @@ public class Platform System.out.println( "Platform id=" + id + " reading Info." + key + " = " + value); - p.put(id + "_" + key, value); + p.put(key, value); /** * @j2sNative @@ -612,4 +613,34 @@ public class Platform } + public static URL getDocumentBase() + { + try + { + return (isJS() ? new URL(/** + * @j2sNative J2S.thisApplet._applet.appletViewer.appletDocumentBase + * || + */ + "") : null); + } catch (MalformedURLException e) + { + return null; + } + } + + public static URL getCodeBase() + { + try + { + return (isJS() ? new URL(/** + * @j2sNative J2S.thisApplet._applet.appletViewer.appletCodeBase + * || + */ + "") : null); + } catch (MalformedURLException e) + { + return null; + } + } + }