public final class SystemEnvironment extends Object
Constructor and Description |
---|
SystemEnvironment() |
Modifier and Type | Method and Description |
---|---|
static int |
getJVMBuildVersionNumber()
Returns the build version number of the current jvm.
|
static int |
getJVMMajorVersionNumber()
Returns the major version number of current jvm.
|
static int |
getJVMMicroVersionNumber()
Returns the micro version number of the current jvm.
|
static int |
getJVMMinorVersionNumber()
Returns the minor version number of the current jvm.
|
static String |
getJVMVersion()
Returns the jvm version as string.
|
static String |
getLineSeparator()
Deprecated.
Use
System.lineSeparator() instead |
static String |
getSystemPropertySecure(String propKey)
Allows secure access to system properties without the risk of a thrown
SecurityException if the calling thread is not allowed to access the system
property with the specified key name. |
static String |
getSystemPropertySecure(String propKey,
String defaultValue)
Allows secure access to system properties without the risk of a thrown
SecurityException if the calling thread is not allowed to access the system
property with the specified key name. |
static String |
getTempDir()
Returns the current temp file path as string.
|
static String |
getTempDir(String defaultValue)
Returns the current temp file path as string.
|
static File |
getTempDirFile(String defaultValue)
Returns the current temp file path as file object.
|
static String |
getUserHome()
Returns the user home path as string.
|
static String |
getUserHome(String defaultValue)
Returns the user home path as string.
|
static File |
getUserHomeFile(String defaultValue)
Returns the user home path as file object.
|
static boolean |
isJVMBuildVersionNewerOrEqual(int version)
Returns whether the current jvm build version is newer or equal to the given number.
|
static boolean |
isJVMMajorVersionNewerOrEqual(int version)
Returns whether the current jvm major version is newer or equal to the given number.
|
static boolean |
isJVMMicroVersionNewerOrEqual(int version)
Returns whether the current jvm micro version is newer or equal to the given number.
|
static boolean |
isJVMMinorVersionNewerOrEqual(int version)
Returns whether the current jvm minor version is newer or equal to the given number.
|
public static String getJVMVersion()
public static int getJVMMajorVersionNumber()
1.5.0_12-b04
, the returned value is 1
. This property is always
accessible and available, so the returning value should be valid.public static int getJVMMinorVersionNumber()
1.5.0_12-b04
, the returned value is 5
. If the jvm version is
1.6.0_04-b12, the returned value is 6
. This property is always accessible and
available, so the returning value should be valid.public static int getJVMMicroVersionNumber()
1.5.0_12-b04
, the returned value is 0
. This property is always
accessible and available, so the returning value should be valid.public static int getJVMBuildVersionNumber()
1.5.0_12-b04
, the returned value is 12
.public static boolean isJVMMajorVersionNewerOrEqual(int version)
getJVMMajorVersionNumber()
public static boolean isJVMMinorVersionNewerOrEqual(int version)
getJVMMinorVersionNumber()
public static boolean isJVMMicroVersionNewerOrEqual(int version)
getJVMMicroVersionNumber()
public static boolean isJVMBuildVersionNewerOrEqual(int version)
getJVMBuildVersionNumber()
@Deprecated public static String getLineSeparator()
System.lineSeparator()
insteadpublic static String getTempDir()
null
will be returned.null
if this property is not available or
accessiblepublic static String getTempDir(String defaultValue)
defaultValue
will be returned.public static File getTempDirFile(String defaultValue)
defaultValue
path will be returned. If the
defaultValue
is null
and the temp file property is not available
null
will be returned.public static String getUserHome()
null
will be returned.null
if this property is not available or
accessiblepublic static String getUserHome(String defaultValue)
defaultValue
will be returned.public static File getUserHomeFile(String defaultValue)
defaultValue
path will be returned. If the
defaultValue
is null
and user home property is not available
null
will be returned.public static String getSystemPropertySecure(String propKey)
SecurityException
if the calling thread is not allowed to access the system
property with the specified key
name. If the property value is not available or
not accessible, null
will be returned.null
if this property is not
available or accessiblepublic static String getSystemPropertySecure(String propKey, String defaultValue)
SecurityException
if the calling thread is not allowed to access the system
property with the specified key
name. If the property value is not available or
not accessible, the given defaulValue
will be returned.defaulValue
if this property
is not available or accessibleCopyright © 2024 levigo holding gmbh. All rights reserved.