public class OperatingSystemInfo extends Object
OperatingSystemMXBean| Modifier and Type | Method and Description |
|---|---|
static OperatingSystemInfo |
create() |
String |
getArchitecture()
Retrieves the operating system architecture.
|
Map<String,Long> |
getDiskSpaceInBytesByRootPaths()
Retrieves the total disk space in bytes by root paths.
|
String |
getDistributionName()
Retrieves the name of the operating system distribution.
|
String |
getName()
Retrieves the name of the operating system.
|
int |
getNumberOfLogicalProcessors()
Retrieves the number of logical processors.
|
long |
getPhysicalMemorySizeInBytes()
Retrieves the physical memory (RAM) size in bytes.
|
long |
getSwapSpaceSizeInBytes()
Retrieves the swap space size in bytes.
|
String |
getVersion()
Retrieves the version of the operating system.
|
public static OperatingSystemInfo create()
public String getName()
getDistributionName() can then be utilized to retrieve the distribution name and version.OperatingSystemMXBean.getName()public String getVersion()
OperatingSystemMXBean.getVersion()public String getDistributionName()
public String getArchitecture()
OperatingSystemMXBean.getArch()public int getNumberOfLogicalProcessors()
OperatingSystemMXBean.getAvailableProcessors()public long getPhysicalMemorySizeInBytes()
OperatingSystemMXBean.getTotalPhysicalMemorySize()public long getSwapSpaceSizeInBytes()
OperatingSystemMXBean.getTotalSwapSpaceSize()Copyright © 2016–2019. All rights reserved.