better preferences/properties
[jalview.git] / src / jalview / util / Platform.java
index 66ce556..96940e5 100644 (file)
@@ -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;
+    }
+  }
+
 }