Class OSInfo

java.lang.Object
org.drasyl.util.OSInfo

public final 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 Details

    • 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