X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FCache.java;h=7dbdc94035b972ee4bba737e5af037c8522675df;hb=6d5aff5f7ace98b6416c7e9dc2a8fdc6ad194902;hp=7eaae62cf7b606e900ac906ace4b15f71ad95da3;hpb=7490127af372f38fe79963113ebc990f7e989255;p=jalview.git diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index 7eaae62..7dbdc94 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -31,31 +31,27 @@ public class Cache public static void loadProperties() { // get last build time. + long date = 0; try{ - long date = 0; - String localFile = Cache.class.getProtectionDomain().getCodeSource().getLocation().toString(); localFile = localFile.concat("!/"); String tmpString = "jar:"; String localJarFileString = tmpString.concat(localFile); java.net.URL localJarFileURL = new java.net.URL(localJarFileString); java.net.JarURLConnection localJarFile = (java.net.JarURLConnection)localJarFileURL.openConnection(); - date = localJarFile.getLastModified(); + }catch(Exception ex){ex.printStackTrace();} + if(date==0) + { + // this is called for unpackaged class files. + // not entirely accurate as it only tells you when Cache.class was last compiled + java.net.URL url = Cache.class.getResource("/jalview/bin/Cache.class"); + java.io.File f = new java.io.File(url.getFile()); + date = f.lastModified(); + } - if(date==0) - { - // this is called for unpackaged class files. - // not entirely accurate as it only tells you when Cache.class was last compiled - java.net.URL url = Cache.class.getResource("/jalview/bin/Cache.class"); - java.io.File f = new java.io.File(url.getFile()); - date = f.lastModified(); - } - - BUILD_DATE = new Date( date ).toString(); - + BUILD_DATE = new Date( date ).toString(); - }catch(Exception ex){ex.printStackTrace();} applicationProperties = new Properties();