Methods Summary |
---|
public static java.util.Properties | getVendorProperties(java.lang.String fileName)Return Vendor properties for a given file name
loadProperties(fileName);
return getVendorProperties();
|
public static java.util.Properties | getVendorProperties()Return Vendor properties
if (_properties == null)
return null;
Properties _vendorProperties = new Properties();
_vendorProperties.setProperty(vendor_name, vendor);
_vendorProperties.setProperty(version_number, parse_version());
return _vendorProperties;
|
public static void | loadProperties(java.lang.String fileName)Load properties file
try {
InputStream in = RuntimeVersion.class.getResourceAsStream(fileName);
if (in == null)
throw new FileNotFoundException(fileName);
_properties.load(in);
in.close();
} catch (java.io.IOException e) {
throw new JDOException(null, e);
}
|
public static void | main(java.lang.String[] args) // NOI18N
if (args == null || args.length == 0 ||
(args.length == 1 && args[0].equals("-version"))) // NOI18N
{
RuntimeVersion rt = new RuntimeVersion();
rt.loadProperties("/com/sun/jdo/spi/persistence/support/sqlstore/sys.properties"); // NOI18N
System.out.println(parse_version());
}
System.exit(0);
|
private static java.lang.String | parse_version()Parse the build date and create a localized version
return version as String
if (_properties == null)
return null;
String majorVersion = _properties.getProperty(product_version);
String minorVersion = _properties.getProperty(runtime_version);
String buildTime = _properties.getProperty(build_time);
// Parse the build date and create a localized version
String s = null;
try {
DateFormat dateFormatter = DateFormat.getDateTimeInstance();
SimpleDateFormat propertyFormat = new SimpleDateFormat("MM/dd/yy hh:mm:ss"); // NOI18N
s = dateFormatter.format(propertyFormat.parse(buildTime));
} catch (Exception e) {
s = ""; // NOI18N
}
return I18NHelper.getMessage(vendor_info, "fullVersion", majorVersion, minorVersion, s); // NOI18N
|