+ private static final String BUILD_VERSION;
+ private static final String BUILD_SOURCE;
+
+ static {
+ try {
+ InputStream is = ClassLoader.getSystemResourceAsStream("build.properties");
+ if (is == null) {
+ throw new MissingResourceException(
+ "build.properties not found, distribution built wrong",
+ "build.properties", "build.version");
+ }
+
+ Properties props = new Properties();
+ props.load(is);
+ is.close();
+
+ BUILD_VERSION = props.getProperty("build.version");
+ if (BUILD_VERSION == null) {
+ throw new MissingResourceException(
+ "build.version not found in property file",
+ "build.properties", "build.version");
+ }
+
+ BUILD_SOURCE = props.getProperty("build.source");
+
+ } catch (IOException e) {
+ throw new MissingResourceException(
+ "Error reading build.properties",
+ "build.properties", "build.version");
+ }
+ }