|
|
@@ -1,37 +0,0 @@
|
|
|
-import oshi.SystemInfo;
|
|
|
-import oshi.hardware.HardwareAbstractionLayer;
|
|
|
-import oshi.software.os.OperatingSystem;
|
|
|
-import oshi.hardware.*;
|
|
|
-import oshi.software.os.*;
|
|
|
-
|
|
|
-import java.util.List;
|
|
|
-import java.util.stream.Collectors;
|
|
|
-
|
|
|
-/**
|
|
|
- * @author reghao
|
|
|
- * @date 2021-10-16 17:00:58
|
|
|
- */
|
|
|
-public class Test {
|
|
|
- public static void main(String[] args) {
|
|
|
- SystemInfo si = new SystemInfo();
|
|
|
-
|
|
|
- OperatingSystem os = si.getOperatingSystem();
|
|
|
- os.getFileSystem().getFileStores().stream()
|
|
|
- .map(osFileStore -> {
|
|
|
- String vol = osFileStore.getVolume();
|
|
|
- String mount = osFileStore.getMount();
|
|
|
- String fsType = osFileStore.getType();
|
|
|
-
|
|
|
- long total = osFileStore.getTotalSpace();
|
|
|
- long userAvail = osFileStore.getUsableSpace();
|
|
|
- long rootAvail = osFileStore.getFreeSpace();
|
|
|
-
|
|
|
- long inodeTotal = osFileStore.getTotalInodes();
|
|
|
- long inodeFree = osFileStore.getFreeInodes();
|
|
|
-
|
|
|
- return osFileStore;
|
|
|
- })
|
|
|
- .collect(Collectors.toList());
|
|
|
- System.out.println();
|
|
|
- }
|
|
|
-}
|