Class SystemPropertiesExtensions

java.lang.Object
io.github.astrapi69.file.system.SystemPropertiesExtensions

public final class SystemPropertiesExtensions extends Object
The SystemPropertiesExtensions class provides utility methods to retrieve common system properties.
  • Field Details

    • OS_ARCH_PROPERTY_KEY

      public static final String OS_ARCH_PROPERTY_KEY
      Key for the OS architecture system property.
      See Also:
    • OS_NAME_PROPERTY_KEY

      public static final String OS_NAME_PROPERTY_KEY
      Key for the OS name system property.
      See Also:
    • OS_VERSION_PROPERTY_KEY

      public static final String OS_VERSION_PROPERTY_KEY
      Key for the OS version system property.
      See Also:
    • USER_HOME_PROPERTY_KEY

      public static final String USER_HOME_PROPERTY_KEY
      Key for the user home directory system property.
      See Also:
    • USER_NAME_PROPERTY_KEY

      public static final String USER_NAME_PROPERTY_KEY
      Key for the user name system property.
      See Also:
    • USER_DIR_PROPERTY_KEY

      public static final String USER_DIR_PROPERTY_KEY
      Key for the user working directory system property.
      See Also:
    • FILE_SEPARATOR_PROPERTY_KEY

      public static final String FILE_SEPARATOR_PROPERTY_KEY
      Key for the file separator system property.
      See Also:
    • LINE_SEPARATOR_PROPERTY_KEY

      public static final String LINE_SEPARATOR_PROPERTY_KEY
      Key for the line separator system property.
      See Also:
    • PATH_SEPARATOR_PROPERTY_KEY

      public static final String PATH_SEPARATOR_PROPERTY_KEY
      Key for the path separator system property.
      See Also:
    • JAVA_IO_TMPDIR_PROPERTY_KEY

      public static final String JAVA_IO_TMPDIR_PROPERTY_KEY
      Key for the Java temporary directory system property.
      See Also:
    • JAVA_CLASS_PATH_PROPERTY_KEY

      public static final String JAVA_CLASS_PATH_PROPERTY_KEY
      Key for the Java class path system property.
      See Also:
    • JAVA_VENDOR_PROPERTY_KEY

      public static final String JAVA_VENDOR_PROPERTY_KEY
      Key for the Java vendor system property.
      See Also:
    • JAVA_HOME_PROPERTY_KEY

      public static final String JAVA_HOME_PROPERTY_KEY
      Key for the Java home directory system property.
      See Also:
    • JAVA_VERSION_PROPERTY_KEY

      public static final String JAVA_VERSION_PROPERTY_KEY
      Key for the Java version system property.
      See Also:
    • JAVA_VENDOR_URL_PROPERTY_KEY

      public static final String JAVA_VENDOR_URL_PROPERTY_KEY
      Key for the Java vendor URL system property.
      See Also:
  • Method Details

    • getFileSeparator

      public static String getFileSeparator()
      Retrieves the system file separator character.
      Returns:
      the system file separator character
    • getJavaIoTmpdir

      public static String getJavaIoTmpdir()
      Retrieves the path for the Java temporary directory.
      Returns:
      the Java temporary directory path
    • getJavaHome

      public static String getJavaHome()
      Retrieves the path of the installed Java home directory.
      Returns:
      the Java home directory path
    • getJavaClassPath

      public static String getJavaClassPath()
      Retrieves the Java class path.
      Returns:
      the Java class path
    • getJavaVendor

      public static String getJavaVendor()
      Retrieves the name of the JRE vendor.
      Returns:
      the name of the JRE vendor
    • getJavaVendorUrl

      public static String getJavaVendorUrl()
      Retrieves the URL of the JRE vendor.
      Returns:
      the URL of the JRE vendor
    • getJavaVersion

      public static String getJavaVersion()
      Retrieves the JRE version.
      Returns:
      the JRE version
    • getLineSeparator

      public static String getLineSeparator()
      Retrieves the system line separator character.
      Returns:
      the system line separator character
    • getOsArchitecture

      public static String getOsArchitecture()
      Retrieves the operating system architecture.
      Returns:
      the operating system architecture
    • getOsName

      public static String getOsName()
      Retrieves the operating system name.
      Returns:
      the operating system name
    • getOsVersion

      public static String getOsVersion()
      Retrieves the operating system version.
      Returns:
      the operating system version
    • getPathSeparator

      public static String getPathSeparator()
      Retrieves the system path separator character used in java.class.path.
      Returns:
      the system path separator character used in java.class.path
    • getUserHome

      public static String getUserHome()
      Retrieves the user home directory.
      Returns:
      the user home directory
    • getUserName

      public static String getUserName()
      Retrieves the user name.
      Returns:
      the user name
    • getUserWorkingDirectory

      public static String getUserWorkingDirectory()
      Retrieves the user working directory.
      Returns:
      the user working directory
    • setSystemProperties

      public static void setSystemProperties(Properties properties)
      Sets each entry from the specified Properties as a system property
      Parameters:
      properties - the Properties to set as system properties