A collection of utilities for accessing and manipulating platform information.
TRLUtils-Platform does not account for any information irrelevant to JRE 8 and newer.
All public-facing code is documented with Javadoc and (mostly) tested with JUnit.
Platform#CURRENT_OSrefers to the current operating system if known.Platform#CURRENT_OS_VERSIONrefers to the current operating system version if known. Only Windows and Mac OS X/macOS versions are implemented, and they can be found inWindowsVersionandMacOSVersion.Platform#JVM_ARCHITECTURErefers to the current JVM architecture (eitherArchitecture#THIRTY_TWO_BITorArchitecture#SIXTY_FOUR_BIT).Platform#JRE_DIRECTORYrefers to the JRE installation directory.Platform#JRE_BIN_DIRECTORYrefers to the JREbindirectory.Platform#JAVA_EXECUTABLE,Platform#JAVAW_EXECUTABLEandPlatform#getJREExecutable(String)can all be used to retrieve the paths of executables found in the JREbindirectory.Platform#getMACAddress(),Platform#getMACAddress(char)andPlatform#getMACAddress(String)can be used to retrieve the MAC address of the local machine.Platform#getClassLocation(Class)can be used to retrieve the base location of any class.
SystemPropertiescontains the majority of the universal Java system properties on JRE 8 and newer.SystemPropertyinstances are used to access and manipulate the values of system properties.- There are several other
*SystemPropertiesclasses for more specific purposes. These are:GroovySystemPropertiesIBMSystemPropertiesMacSystemPropertiesMiscSystemPropertiesSunSystemProperties
- Custom
SystemPropertyinstances can be constructed by either implementingSystemPropertyor using one of the preexistingSystemPropertyimplementations undercom.therandomlabs.utils.platform.systemproperty.type, which include integers, booleans and path lists.