public final class SystemProperties
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
AWT_TOOLKIT
The System property name "awt.toolkit".
|
static java.lang.String |
FILE_ENCODING
The System property name "file.encoding".
|
static java.lang.String |
FILE_SEPARATOR
The System property name "file.separator".
|
static java.lang.String |
JAVA_AWT_FONTS
The System property name "java.awt.fonts".
|
static java.lang.String |
JAVA_AWT_GRAPHICSENV
The System property name "java.awt.graphicsenv".
|
static java.lang.String |
JAVA_AWT_HEADLESS
The System property name "java.awt.headless".
|
static java.lang.String |
JAVA_AWT_PRINTERJOB
The System property name "java.awt.printerjob".
|
static java.lang.String |
JAVA_CLASS_PATH
The System property name "java.class.path".
|
static java.lang.String |
JAVA_CLASS_VERSION
The System property name "java.class.version".
|
static java.lang.String |
JAVA_COMPILER
The System property name "java.compiler".
|
static java.lang.String |
JAVA_ENDORSED_DIRS
The System property name "java.endorsed.dirs".
|
static java.lang.String |
JAVA_EXT_DIRS
The System property name "java.ext.dirs".
|
static java.lang.String |
JAVA_HOME
The System property name "java.home".
|
static java.lang.String |
JAVA_IO_TMPDIR
The System property name "java.io.tmpdir".
|
static java.lang.String |
JAVA_LIBRARY_PATH
The System property name "java.library.path".
|
static java.lang.String |
JAVA_LOCALE_PROVIDERS
The System property name "java.locale.providers".
|
static java.lang.String |
JAVA_RUNTIME_NAME
The System property name "java.runtime.name".
|
static java.lang.String |
JAVA_RUNTIME_VERSION
The System property name "java.runtime.version".
|
static java.lang.String |
JAVA_SPECIFICATION_NAME
The System property name "java.specification.name".
|
static java.lang.String |
JAVA_SPECIFICATION_VENDOR
The System property name "java.specification.vendor".
|
static java.lang.String |
JAVA_SPECIFICATION_VERSION
The System property name "java.specification.version".
|
static java.lang.String |
JAVA_UTIL_PREFS_PREFERENCES_FACTORY
The System property name "java.util.prefs.PreferencesFactory".
|
static java.lang.String |
JAVA_VENDOR
The System property name "java.vendor".
|
static java.lang.String |
JAVA_VENDOR_URL
The System property name "java.vendor.url".
|
static java.lang.String |
JAVA_VERSION
The System property name "java.version".
|
static java.lang.String |
JAVA_VM_INFO
The System property name "java.vm.info".
|
static java.lang.String |
JAVA_VM_NAME
The System property name "java.vm.name".
|
static java.lang.String |
JAVA_VM_SPECIFICATION_NAME
The System property name "java.vm.specification.name".
|
static java.lang.String |
JAVA_VM_SPECIFICATION_VENDOR
The System property name "java.vm.specification.vendor".
|
static java.lang.String |
JAVA_VM_SPECIFICATION_VERSION
The System property name "java.vm.specification.version".
|
static java.lang.String |
JAVA_VM_VENDOR
The System property name "java.vm.vendor".
|
static java.lang.String |
JAVA_VM_VERSION
The System property name "java.vm.version".
|
static java.lang.String |
LINE_SEPARATOR
The System property name "line.separator".
|
static java.lang.String |
OS_ARCH
The System property name "os.arch".
|
static java.lang.String |
OS_NAME
The System property name "os.name".
|
static java.lang.String |
OS_VERSION
The System property name "os.version".
|
static java.lang.String |
PATH_SEPARATOR
The System property name "path.separator".
|
static java.lang.String |
USER_COUNTRY
The System property name "user.country".
|
static java.lang.String |
USER_DIR
The System property name "user.dir".
|
static java.lang.String |
USER_HOME
The System property name "user.home".
|
static java.lang.String |
USER_LANGUAGE
The System property name "user.language".
|
static java.lang.String |
USER_NAME
The System property name "user.name".
|
static java.lang.String |
USER_REGION
The System property name "user.region".
|
static java.lang.String |
USER_TIMEZONE
The System property name "user.timezone".
|
Constructor and Description |
---|
SystemProperties() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
getAwtToolkit()
Gets the current value from the system properties map.
|
static boolean |
getBoolean(java.lang.String key,
java.util.function.BooleanSupplier defaultIfAbsent)
Gets the current value for the property named
key as an boolean . |
static java.lang.String |
getFileEncoding()
Gets the current value from the system properties map.
|
static java.lang.String |
getFileSeparator()
Gets the current value from the system properties map.
|
static int |
getInt(java.lang.String key,
java.util.function.IntSupplier defaultIfAbsent)
Gets the current value for the property named
key as an int . |
static java.lang.String |
getJavaAwtFonts()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaAwtGraphicsenv()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaAwtHeadless()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaAwtPrinterjob()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaClassPath()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaClassVersion()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaCompiler()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaEndorsedDirs()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaExtDirs()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaHome()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaIoTmpdir()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaLibraryPath()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaLocaleProviders()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaRuntimeName()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaRuntimeVersion()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaSpecificationName()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaSpecificationVendor()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaSpecificationVersion()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaUtilPrefsPreferencesFactory()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaVendor()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaVendorUrl()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaVersion()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaVmInfo()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaVmName()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaVmSpecificationName()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaVmSpecificationVendor()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaVmSpecificationVersion()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaVmVendor()
Gets the current value from the system properties map.
|
static java.lang.String |
getJavaVmVersion()
Gets the current value from the system properties map.
|
static java.lang.String |
getLineSeparator()
Gets the current value from the system properties map.
|
static long |
getLong(java.lang.String key,
java.util.function.LongSupplier defaultIfAbsent)
Gets the current value for the property named
key as a long . |
static java.lang.String |
getOsArch()
Gets the current value from the system properties map.
|
static java.lang.String |
getOsName()
Gets the current value from the system properties map.
|
static java.lang.String |
getOsVersion()
Gets the current value from the system properties map.
|
static java.lang.String |
getPathSeparator()
Gets the current value from the system properties map.
|
static java.lang.String |
getProperty(java.lang.String property)
Gets a System property, defaulting to
null if the property cannot be read. |
static java.lang.String |
getUserCountry()
Gets the current value from the system properties map.
|
static java.lang.String |
getUserDir()
Gets the current value from the system properties map.
|
static java.lang.String |
getUserHome()
Gets the current value from the system properties map.
|
static java.lang.String |
getUserLanguage()
Gets the current value from the system properties map.
|
static java.lang.String |
getUserName()
Gets the current value from the system properties map.
|
static java.lang.String |
getUserTimezone()
Gets the current value from the system properties map.
|
public static final java.lang.String AWT_TOOLKIT
public static final java.lang.String FILE_ENCODING
public static final java.lang.String FILE_SEPARATOR
public static final java.lang.String JAVA_AWT_FONTS
public static final java.lang.String JAVA_AWT_GRAPHICSENV
public static final java.lang.String JAVA_AWT_HEADLESS
public static final java.lang.String JAVA_AWT_PRINTERJOB
public static final java.lang.String JAVA_CLASS_PATH
public static final java.lang.String JAVA_CLASS_VERSION
public static final java.lang.String JAVA_COMPILER
public static final java.lang.String JAVA_ENDORSED_DIRS
public static final java.lang.String JAVA_EXT_DIRS
public static final java.lang.String JAVA_HOME
public static final java.lang.String JAVA_IO_TMPDIR
public static final java.lang.String JAVA_LIBRARY_PATH
public static final java.lang.String JAVA_LOCALE_PROVIDERS
public static final java.lang.String JAVA_RUNTIME_NAME
public static final java.lang.String JAVA_RUNTIME_VERSION
public static final java.lang.String JAVA_SPECIFICATION_NAME
public static final java.lang.String JAVA_SPECIFICATION_VENDOR
public static final java.lang.String JAVA_SPECIFICATION_VERSION
public static final java.lang.String JAVA_UTIL_PREFS_PREFERENCES_FACTORY
public static final java.lang.String JAVA_VENDOR
public static final java.lang.String JAVA_VENDOR_URL
public static final java.lang.String JAVA_VERSION
public static final java.lang.String JAVA_VM_INFO
public static final java.lang.String JAVA_VM_NAME
public static final java.lang.String JAVA_VM_SPECIFICATION_NAME
public static final java.lang.String JAVA_VM_SPECIFICATION_VENDOR
public static final java.lang.String JAVA_VM_SPECIFICATION_VERSION
public static final java.lang.String JAVA_VM_VENDOR
public static final java.lang.String JAVA_VM_VERSION
public static final java.lang.String LINE_SEPARATOR
public static final java.lang.String OS_ARCH
public static final java.lang.String OS_NAME
public static final java.lang.String OS_VERSION
public static final java.lang.String PATH_SEPARATOR
public static final java.lang.String USER_COUNTRY
public static final java.lang.String USER_DIR
public static final java.lang.String USER_HOME
public static final java.lang.String USER_LANGUAGE
public static final java.lang.String USER_NAME
public static final java.lang.String USER_REGION
public static final java.lang.String USER_TIMEZONE
public static java.lang.String getAwtToolkit()
Returns null
if the property cannot be read due to a SecurityException
.
public static boolean getBoolean(java.lang.String key, java.util.function.BooleanSupplier defaultIfAbsent)
key
as an boolean
.key
- The keydefaultIfAbsent
- The default valueboolean
or defaultIfAbsentpublic static java.lang.String getFileEncoding()
Returns null
if the property cannot be read due to a SecurityException
.
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getFileSeparator()
Returns null
if the property cannot be read due to a SecurityException
.
public static int getInt(java.lang.String key, java.util.function.IntSupplier defaultIfAbsent)
key
as an int
.key
- The keydefaultIfAbsent
- The default valueint
or defaultIfAbsentpublic static java.lang.String getJavaAwtFonts()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaAwtGraphicsenv()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaAwtHeadless()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaAwtPrinterjob()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaClassPath()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaClassVersion()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaCompiler()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaEndorsedDirs()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaExtDirs()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaHome()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaIoTmpdir()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaLibraryPath()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaLocaleProviders()
Returns null
if the property cannot be read due to a SecurityException
.
Java 9 and above.
public static java.lang.String getJavaRuntimeName()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaRuntimeVersion()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaSpecificationName()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaSpecificationVendor()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaSpecificationVersion()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaUtilPrefsPreferencesFactory()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaVendor()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaVendorUrl()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaVersion()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaVmInfo()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaVmName()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaVmSpecificationName()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaVmSpecificationVendor()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaVmSpecificationVersion()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaVmVendor()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getJavaVmVersion()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getLineSeparator()
Returns null
if the property cannot be read due to a SecurityException
.
public static long getLong(java.lang.String key, java.util.function.LongSupplier defaultIfAbsent)
key
as a long
.key
- The keydefaultIfAbsent
- The default valuelong
or defaultIfAbsentpublic static java.lang.String getOsArch()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getOsName()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getOsVersion()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getPathSeparator()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getProperty(java.lang.String property)
null
if the property cannot be read.
If a SecurityException
is caught, the return value is null
.
property
- the system property namenull
if a security problem occurspublic static java.lang.String getUserCountry()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getUserDir()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getUserHome()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getUserLanguage()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getUserName()
Returns null
if the property cannot be read due to a SecurityException
.
public static java.lang.String getUserTimezone()
Returns null
if the property cannot be read due to a SecurityException
.
Copyright © 2010 - 2023 Adobe. All Rights Reserved