public class Version extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
PROP_BUILD_DATE
Version property whose value is the date when this version of the product was built.
|
static String |
PROP_BUILD_JDK_VENDOR
Version property whose value is the vendor of the JDK that built this version of the product.
|
static String |
PROP_BUILD_JDK_VERSION
Version property whose value is the version of the JDK that built this version of the product.
|
static String |
PROP_BUILD_NUMBER
Version property whose value is the source code revision number used to make the build.
|
static String |
PROP_BUILD_OS_NAME
Version property whose value identifies the build machine's operating system.
|
static String |
PROP_BUILD_OS_VERSION
Version property whose value is the build machine's operating system version.
|
static String |
PROP_PRODUCT_NAME
Version property whose value is the product name.
|
static String |
PROP_PRODUCT_VERSION
Version property whose value is the product version.
|
| Constructor and Description |
|---|
Version() |
| Modifier and Type | Method and Description |
|---|---|
static Date |
getBuildDate()
Returns just the product build date.
|
static String |
getBuildNumber()
Returns just the product build number.
|
static String |
getProductName()
Returns just the product name.
|
static String |
getProductNameAndVersion()
Returns the product name and its version string.
|
static String |
getProductVersion()
Returns just the product version.
|
static Properties |
getVersionProperties()
Returns a set of properties that can be used to identify this version of the product.
|
static String |
getVersionPropertiesAsString()
Returns the version properties in a single string with all properties on a single line separated with a newline.
|
static Date |
getVersionPropertyAsDate(String date_string)
When a version property represents a date, this method will take that date string and convert it to a
java.util.Date object. |
static void |
main(String[] args)
A main method that can be used to determine the version information from a command line.
|
public static final String PROP_PRODUCT_NAME
public static final String PROP_PRODUCT_VERSION
public static final String PROP_BUILD_NUMBER
public static final String PROP_BUILD_DATE
public static final String PROP_BUILD_JDK_VENDOR
public static final String PROP_BUILD_JDK_VERSION
public static final String PROP_BUILD_OS_NAME
public static final String PROP_BUILD_OS_VERSION
public static void main(String[] args)
args - the version properties to print to stdout; if no arguments are given then all version properties are
printedpublic static String getProductNameAndVersion()
public static String getProductName()
public static String getProductVersion()
public static Date getBuildDate()
null if the date could not be determined due to an invalid date
formatpublic static String getBuildNumber()
public static Properties getVersionProperties()
RuntimeException - if there is no VERSION file found in the current thread's class loaderpublic static String getVersionPropertiesAsString()
public static Date getVersionPropertyAsDate(String date_string)
java.util.Date object.
Assumes the date string is in the en.US locale based form of dd.MMM.yyyy HH.mm.ss z
date_string - the version property date string to convertdataString as a java.util.Date object or null if the
date string was in an invalid formatCopyright © 2008-2014 Red Hat, Inc.. All Rights Reserved.