app-specific property caching
[jalview.git] / src / jalview / bin / Cache.java
index b018f9c..3e5d583 100755 (executable)
@@ -289,6 +289,8 @@ public class Cache
 
   private static boolean propsAreReadOnly = Platform.isJS();
 
+  private static String JS_PROPERTY_PREFIX = "jalview_";
+
   public static void initLogger()
   {
     if (log != null)
@@ -351,7 +353,10 @@ public class Cache
       propsAreReadOnly = true;
     }
 
-    if (propertiesFile != null) {
+    if (propertiesFile == null) 
+    { // BH 2019
+       Platform.readInfoProperties(JS_PROPERTY_PREFIX , applicationProperties);
+    } else {
            try
            {
              InputStream fis;
@@ -593,7 +598,14 @@ public class Cache
    */
   public static String getProperty(String key)
   {
-    return applicationProperties.getProperty(key);
+         
+    String prop = applicationProperties.getProperty(key);
+    if (prop == null && Platform.isJS()) 
+    {
+       prop = applicationProperties.getProperty(Platform.getUniqueAppletID() + "_" + JS_PROPERTY_PREFIX + key);
+    }
+    
+    return prop;
   }
 
   /**