1 45 46 47 package org.exolab.jms.util; 48 49 import java.util.Properties ; 50 51 52 59 public final class Version { 60 61 64 public static final String VENDOR_NAME; 65 66 69 public static final String VENDOR_URL; 70 71 74 public static final String VERSION; 75 76 79 public static final int MAJOR_VERSION; 80 81 84 public static final int MINOR_VERSION; 85 86 89 public static final String BUILD_DATE; 90 91 94 public static final String TITLE; 95 96 99 public static final String COPYRIGHT; 100 101 104 public static final String FILE_NAME = "openjms.version"; 105 106 109 private static final String RESOURCE_NAME = "/org/exolab/jms/" + FILE_NAME; 110 111 114 private Version() { 115 } 116 117 120 public static void main(String args[]) { 121 System.err.println(TITLE + " " + VERSION + " (" + BUILD_DATE + ")"); 122 System.err.println(VENDOR_NAME + " (" + VENDOR_URL + ")"); 123 System.err.println(COPYRIGHT); 124 } 125 126 static { 127 Properties properties = new Properties (); 128 int major = -1; 129 int minor = -1; 130 131 try { 133 properties.load(Version.class.getResourceAsStream(RESOURCE_NAME)); 134 major = Integer.parseInt(properties.getProperty("version.major")); 135 minor = Integer.parseInt(properties.getProperty("version.minor")); 136 } catch (Exception exception) { 137 System.err.println("Error loading " + RESOURCE_NAME + ": " + 139 exception.getMessage()); 140 } 141 142 VENDOR_NAME = properties.getProperty("version.vendorName"); 143 VENDOR_URL = properties.getProperty("version.vendorUrl"); 144 VERSION = properties.getProperty("version"); 145 146 MAJOR_VERSION = major; 147 MINOR_VERSION = minor; 148 BUILD_DATE = properties.getProperty("build.date"); 149 150 TITLE = properties.getProperty("version.title"); 151 COPYRIGHT = properties.getProperty("version.copyright"); 152 } 153 154 } | Popular Tags |