Package io.github.astrapi69.file.system
Class SystemPropertiesExtensions
java.lang.Object
io.github.astrapi69.file.system.SystemPropertiesExtensions
The
SystemPropertiesExtensions
class provides utility methods to retrieve common system
properties.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
Key for the file separator system property.static final String
Key for the Java class path system property.static final String
Key for the Java home directory system property.static final String
Key for the Java temporary directory system property.static final String
Key for the Java vendor system property.static final String
Key for the Java vendor URL system property.static final String
Key for the Java version system property.static final String
Key for the line separator system property.static final String
Key for the OS architecture system property.static final String
Key for the OS name system property.static final String
Key for the OS version system property.static final String
Key for the path separator system property.static final String
Key for the user working directory system property.static final String
Key for the user home directory system property.static final String
Key for the user name system property. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
Retrieves the system file separator character.static String
Retrieves the Java class path.static String
Retrieves the path of the installed Java home directory.static String
Retrieves the path for the Java temporary directory.static String
Retrieves the name of the JRE vendor.static String
Retrieves the URL of the JRE vendor.static String
Retrieves the JRE version.static String
Retrieves the system line separator character.static String
Retrieves the operating system architecture.static String
Retrieves the operating system name.static String
Retrieves the operating system version.static String
Retrieves the system path separator character used in java.class.path.static String
Retrieves the user home directory.static String
Retrieves the user name.static String
Retrieves the user working directory.static void
setSystemProperties
(Properties properties) Sets each entry from the specifiedProperties
as a system property
-
Field Details
-
OS_ARCH_PROPERTY_KEY
Key for the OS architecture system property.- See Also:
-
OS_NAME_PROPERTY_KEY
Key for the OS name system property.- See Also:
-
OS_VERSION_PROPERTY_KEY
Key for the OS version system property.- See Also:
-
USER_HOME_PROPERTY_KEY
Key for the user home directory system property.- See Also:
-
USER_NAME_PROPERTY_KEY
Key for the user name system property.- See Also:
-
USER_DIR_PROPERTY_KEY
Key for the user working directory system property.- See Also:
-
FILE_SEPARATOR_PROPERTY_KEY
Key for the file separator system property.- See Also:
-
LINE_SEPARATOR_PROPERTY_KEY
Key for the line separator system property.- See Also:
-
PATH_SEPARATOR_PROPERTY_KEY
Key for the path separator system property.- See Also:
-
JAVA_IO_TMPDIR_PROPERTY_KEY
Key for the Java temporary directory system property.- See Also:
-
JAVA_CLASS_PATH_PROPERTY_KEY
Key for the Java class path system property.- See Also:
-
JAVA_VENDOR_PROPERTY_KEY
Key for the Java vendor system property.- See Also:
-
JAVA_HOME_PROPERTY_KEY
Key for the Java home directory system property.- See Also:
-
JAVA_VERSION_PROPERTY_KEY
Key for the Java version system property.- See Also:
-
JAVA_VENDOR_URL_PROPERTY_KEY
Key for the Java vendor URL system property.- See Also:
-
-
Method Details
-
getFileSeparator
Retrieves the system file separator character.- Returns:
- the system file separator character
-
getJavaIoTmpdir
Retrieves the path for the Java temporary directory.- Returns:
- the Java temporary directory path
-
getJavaHome
Retrieves the path of the installed Java home directory.- Returns:
- the Java home directory path
-
getJavaClassPath
Retrieves the Java class path.- Returns:
- the Java class path
-
getJavaVendor
Retrieves the name of the JRE vendor.- Returns:
- the name of the JRE vendor
-
getJavaVendorUrl
Retrieves the URL of the JRE vendor.- Returns:
- the URL of the JRE vendor
-
getJavaVersion
Retrieves the JRE version.- Returns:
- the JRE version
-
getLineSeparator
Retrieves the system line separator character.- Returns:
- the system line separator character
-
getOsArchitecture
Retrieves the operating system architecture.- Returns:
- the operating system architecture
-
getOsName
Retrieves the operating system name.- Returns:
- the operating system name
-
getOsVersion
Retrieves the operating system version.- Returns:
- the operating system version
-
getPathSeparator
Retrieves the system path separator character used in java.class.path.- Returns:
- the system path separator character used in java.class.path
-
getUserHome
Retrieves the user home directory.- Returns:
- the user home directory
-
getUserName
Retrieves the user name.- Returns:
- the user name
-
getUserWorkingDirectory
Retrieves the user working directory.- Returns:
- the user working directory
-
setSystemProperties
Sets each entry from the specifiedProperties
as a system property- Parameters:
properties
- theProperties
to set as system properties
-