JAL-3247 Changed JVL file to be a props file, with appbase=... required for the new...
[jalview.git] / getdown / src / getdown / launcher / src / main / java / com / threerings / getdown / launcher / Getdown.java
index e0f7c35..e3c7090 100644 (file)
@@ -15,6 +15,7 @@ import java.awt.event.ActionEvent;
 import java.awt.image.BufferedImage;
 import java.io.BufferedReader;
 import java.io.File;
+import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
@@ -1067,22 +1068,22 @@ public abstract class Getdown extends Thread
             // Do something special with this here
             File f = new File(filename);
             if (f.exists()) {
-              String line = null;
+              String appbase = null;
               try {
-                FileReader fr = new FileReader(f);
-                BufferedReader br = new BufferedReader(fr);
-                line = br.readLine();
-                br.close();
+                java.util.Properties jvlprops = new java.util.Properties();
+                FileInputStream in = new FileInputStream(f);
+                jvlprops.load(in);
+                in.close();
+                appbase = jvlprops.getProperty("appbase");
               } catch(Exception e) {
                 log.warning("Something went wrong reading Jalview Version Locator file '"+filename+"'", e);
               }
-              if (line != null) {
-                String urlString = line.trim();
+              if (appbase != null) {
                 try {
-                  URL newAppbase = new URL(urlString);
+                  URL newAppbase = new URL(appbase);
                   _app.newAppbase(newAppbase);
                 } catch(MalformedURLException e) {
-                  log.warning("Java Version Locator url '"+urlString+"' found in file '"+filename+"' is malformed", e);
+                  log.warning("Java Version Locator url '"+appbase+"' found in file '"+filename+"' is malformed", e);
                 }
               }
             }