X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=getdown%2Fsrc%2Fgetdown%2Flauncher%2Fsrc%2Fmain%2Fjava%2Fcom%2Fthreerings%2Fgetdown%2Flauncher%2FGetdown.java;h=e0f7c356a311a31f648e77fa02d215eb4cb96be2;hb=46ba8ba2466d929d023295f38bc3572aef5467f1;hp=ae679e27f9ccd7646cdfbd524823494bc72df4df;hpb=29701f0d4bd7f80989b0a3095d44d2dd8e1644bd;p=jalview.git diff --git a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java index ae679e2..e0f7c35 100644 --- a/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java +++ b/getdown/src/getdown/launcher/src/main/java/com/threerings/getdown/launcher/Getdown.java @@ -16,11 +16,13 @@ import java.awt.image.BufferedImage; import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; +import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintStream; import java.net.HttpURLConnection; +import java.net.MalformedURLException; import java.net.URL; import java.util.*; @@ -1051,16 +1053,39 @@ public abstract class Getdown extends Thread if (j > -1) { ext = filename.substring(j+1); } - // jvp files - if (ext.equals("jvp")) { + // jvp files etc + boolean addedStartupFile = false; // only add one startup file + if (_app.startupFileExtensions.contains(ext.toLowerCase()) && ! addedStartupFile) { File f = new File(filename); if (f.exists()) { _app.addStartupFile(f); + addedStartupFile = true; } } // jvl files - if (ext.equals("jvl")) { - // Do stuff with the appbase here! + if (_app.locatorFileExtension.equals(ext.toLowerCase())) { + // Do something special with this here + File f = new File(filename); + if (f.exists()) { + String line = null; + try { + FileReader fr = new FileReader(f); + BufferedReader br = new BufferedReader(fr); + line = br.readLine(); + br.close(); + } catch(Exception e) { + log.warning("Something went wrong reading Jalview Version Locator file '"+filename+"'", e); + } + if (line != null) { + String urlString = line.trim(); + try { + URL newAppbase = new URL(urlString); + _app.newAppbase(newAppbase); + } catch(MalformedURLException e) { + log.warning("Java Version Locator url '"+urlString+"' found in file '"+filename+"' is malformed", e); + } + } + } } } } @@ -1099,4 +1124,5 @@ public abstract class Getdown extends Thread protected static final int MAX_LOOPS = 5; protected static final long FALLBACK_CHECK_TIME = 1000L; + }