From 338584e2151df68daca4085183a757610aa55909 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Tue, 24 May 2005 11:23:15 +0000 Subject: [PATCH] URL getresource adds %20 for spaces. Use user.dir instead --- src/jalview/bin/Cache.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/jalview/bin/Cache.java b/src/jalview/bin/Cache.java index ed1a93f..66518fa 100755 --- a/src/jalview/bin/Cache.java +++ b/src/jalview/bin/Cache.java @@ -15,7 +15,7 @@ import java.util.jar.*; public class Cache { public static String VERSION = "Release 2.0"; - public static String BUILD_DATE = "01-05-2005"; + public static String BUILD_DATE = ""; public static Properties applicationProperties; // Current properties include: @@ -43,14 +43,17 @@ public class Cache }catch(Exception ex){ex.printStackTrace();} if(date==0) { - // this is called for unpackaged class files. + // this is called for unpackaged class files, ie not in a Jar file + // InstallAnywhere version will find build date this way // 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(); + + + java.io.File f = new java.io.File(System.getProperty("user.dir") + "/jalview/bin/Cache.class" ); + date = f.lastModified(); } - BUILD_DATE = new Date( date ).toString(); + if(date!=0) + BUILD_DATE = new Date( date ).toString(); applicationProperties = new Properties(); -- 1.7.10.2