X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FCache.java;h=e2477d9eab317abb2452fff15073bfd7a4f3770f;hb=b8d09897dacc7b0ad203982b4578e2c1d8929142;hp=d4c7e5de2f7064675905e547dd099c0ec4b1f5ce;hpb=1ee8b306b296ea2724e128f66486675bdaac7a3d;p=jalview.git diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index d4c7e5d..e2477d9 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -52,7 +52,6 @@ public class Cache public static void loadProperties(String propsFile) { applicationProperties = new Properties(); - propertiesFile = propsFile; if (propsFile == null) { @@ -63,6 +62,8 @@ public class Cache { FileInputStream fis = new FileInputStream(propertiesFile); applicationProperties.load(fis); + applicationProperties.remove("LATEST_VERSION"); + applicationProperties.remove("VERSION"); fis.close(); } catch (Exception ex) @@ -90,11 +91,20 @@ public class Cache catch (Exception ex) { System.out.println("Error reading build details: "+ex); + applicationProperties.remove("VERSION"); } String jnlpVersion = System.getProperty("jalview.version"); String codeVersion = getProperty("VERSION"); + + if(codeVersion==null) + { + // THIS SHOULD ONLY BE THE CASE WHEN TESTING!! + codeVersion = "Test"; + jnlpVersion = "Test"; + } + // jnlpVersion will be null if we're using InstallAnywhere if(jnlpVersion==null) { @@ -109,11 +119,18 @@ public class Cache line = line.substring(line.indexOf("value=")+7); line = line.substring(0, line.lastIndexOf("\"")); - setProperty("jalview.version", line); + jnlpVersion = line; + break; } }catch(Exception ex) - {setProperty("jalview.version", codeVersion);} + { jnlpVersion = codeVersion; } } + + System.out.println("Version: "+codeVersion); + System.out.println("Latest : "+jnlpVersion); + + setProperty("LATEST_VERSION", jnlpVersion); + setProperty("VERSION", codeVersion); } /**