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;
// 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);
}
}
}