1 9 10 package org.enhydra.jawe.misc; 11 12 import java.io.InputStream ; 13 import java.util.PropertyResourceBundle ; 14 import java.util.ResourceBundle ; 15 16 19 public class Version { 20 21 private static ResourceBundle versionResource; 22 23 private static String version = ""; 24 25 static { 26 try { 27 String vp="org/enhydra/jawe/resources/version.properties"; 28 InputStream is=Version.class.getClassLoader().getResourceAsStream(vp); 29 if (is != null) { 30 versionResource = new PropertyResourceBundle (is); 31 String stat = versionResource.getString("version.status"); 32 if (stat.equals("")){ 34 version = 35 versionResource.getString("version.number.major") 36 + "." 37 + versionResource.getString("version.number.minor") 38 + " (build " 39 + versionResource.getString("version.build") 40 + ")"; 41 } else{ 43 version = 44 versionResource.getString("version.number.major") 45 + "." 46 + versionResource.getString("version.number.minor") 47 + "-" + stat + " (build " 48 + versionResource.getString("version.build") 49 + ")"; 50 } 51 } 52 } catch (java.io.IOException e) { 53 System.err.println(e.getMessage()); 54 version = "{File version.properties not available.}"; 55 } 56 } 57 58 60 public static String getVersion() { 61 return version; 62 } 63 64 } 65 | Popular Tags |