Package org.drasyl.util
Class OSInfo
- java.lang.Object
-
- org.drasyl.util.OSInfo
-
public class OSInfo extends Object
Utility class that can be used to detect properties specific to the current runtime environment/operating system, such as os name.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
availableProcessors()
String
cpuName()
String
currentUser()
static OSInfo
getInstance()
String
hostname()
String
osArch()
String
osName()
String
osVersion()
long
totalMemory()
This method does NOT return the JVM memory.
-
-
-
Method Detail
-
getInstance
public static OSInfo getInstance()
-
osName
public String osName()
- Returns:
- the OS name
-
osVersion
public String osVersion()
- Returns:
- the OS version
-
osArch
public String osArch()
- Returns:
- the OS arch
-
currentUser
public String currentUser()
- Returns:
- the current user, that is executing this JVM
-
hostname
public String hostname()
- Returns:
- the hostname of the executing JVM
-
availableProcessors
public int availableProcessors()
- Returns:
- the number of available cores (can be virtual)
-
totalMemory
public long totalMemory()
This method does NOT return the JVM memory. Instead, it returns the total available system memory.- Returns:
- the amount of total system memory
-
cpuName
public String cpuName()
- Returns:
- return the CPU name
-
-