|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.levigo.jadice.document.util.SystemEnvironment
public final class SystemEnvironment
SystemEnvironment is a utility class to provide different informations about the system environment.
Constructor Summary | |
---|---|
SystemEnvironment()
|
Method Summary | |
---|---|
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()
Returns the line separator which depends on the current os. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SystemEnvironment()
Method Detail |
---|
public static final String getJVMVersion()
public static final 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 final 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 final 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 final int getJVMBuildVersionNumber()
1.5.0_12-b04
, the returned value is 12
.
public static final boolean isJVMMajorVersionNewerOrEqual(int version)
version
-
getJVMMajorVersionNumber()
public static final boolean isJVMMinorVersionNewerOrEqual(int version)
version
-
getJVMMinorVersionNumber()
public static final boolean isJVMMicroVersionNewerOrEqual(int version)
version
-
getJVMMicroVersionNumber()
public static final boolean isJVMBuildVersionNewerOrEqual(int version)
version
-
getJVMBuildVersionNumber()
public static final String getLineSeparator()
public static final String getTempDir()
null
will be returned.
null
if this property is not available or
accessiblepublic static final String getTempDir(String defaultValue)
defaultValue
will be returned.
public static final 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 final String getUserHome()
null
will be returned.
null
if this property is not available or
accessiblepublic static final String getUserHome(String defaultValue)
defaultValue
will be returned.
public static final 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 final 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 final 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 accessible
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |