1 17 18 package org.apache.geronimo.system.serverinfo; 19 20 import java.util.Properties ; 21 22 27 public class ServerConstants { 28 private static final String VERSION; 29 private static final String BUILD_DATE; 30 private static final String BUILD_TIME; 31 private static final String COPYRIGHT; 32 33 37 public static String getVersion() { 38 return VERSION; 39 } 40 41 45 public static String getBuildDate() { 46 return BUILD_DATE; 47 } 48 49 53 public static String getBuildTime() { 54 return BUILD_TIME; 55 } 56 57 61 public static String getCopyright() { 62 return COPYRIGHT; 63 } 64 65 68 static { 69 Properties versionInfo = new Properties (); 70 try { 71 java.io.InputStream input = ServerConstants.class.getClassLoader().getResourceAsStream("org/apache/geronimo/system/serverinfo/geronimo-version.properties"); 72 if (input == null) { 73 throw new Error ("Missing geronimo-version.properties"); 74 } 75 76 versionInfo.load(input); 77 } 78 catch (java.io.IOException e) { 79 throw new Error ("Could not load geronimo-version.properties", e); 80 } 81 82 VERSION = versionInfo.getProperty("version"); 83 if (VERSION == null || VERSION.length() == 0) { 84 throw new Error ("geronimo-version.properties does not contain a 'version' property"); 85 } 86 87 BUILD_DATE = versionInfo.getProperty("build.date"); 88 if (BUILD_DATE == null || BUILD_DATE.length() == 0) { 89 throw new Error ("geronimo-version.properties does not contain a 'build.date' property"); 90 } 91 92 BUILD_TIME = versionInfo.getProperty("build.time"); 93 if (BUILD_TIME == null || BUILD_TIME.length() == 0) { 94 throw new Error ("geronimo-version.properties does not contain a 'build.time' property"); 95 } 96 97 COPYRIGHT = versionInfo.getProperty("copyright"); 98 if (COPYRIGHT == null || COPYRIGHT.length() == 0) { 99 throw new Error ("geronimo-version.properties does not contain a 'copyright' property"); 100 } 101 } 102 } 103 | Popular Tags |