(FileSystem fileSystem)
| 346 | } |
| 347 | |
| 348 | private static void printFileSystem(FileSystem fileSystem) { |
| 349 | oshi.add("File System:"); |
| 350 | |
| 351 | oshi.add(String.format(" File Descriptors: %d/%d", fileSystem.getOpenFileDescriptors(), |
| 352 | fileSystem.getMaxFileDescriptors())); |
| 353 | |
| 354 | for (OSFileStore fs : fileSystem.getFileStores()) { |
| 355 | long usable = fs.getUsableSpace(); |
| 356 | long total = fs.getTotalSpace(); |
| 357 | oshi.add(String.format( |
| 358 | " %s (%s) [%s] %s of %s free (%.1f%%), %s of %s files free (%.1f%%) is %s " |
| 359 | + (fs.getLogicalVolume() != null && fs.getLogicalVolume().length() > 0 ? "[%s]" : "%s") |
| 360 | + " and is mounted at %s", |
| 361 | fs.getName(), fs.getDescription().isEmpty() ? "file system" : fs.getDescription(), fs.getType(), |
| 362 | FormatUtil.formatBytes(usable), FormatUtil.formatBytes(fs.getTotalSpace()), 100d * usable / total, |
| 363 | FormatUtil.formatValue(fs.getFreeInodes(), ""), FormatUtil.formatValue(fs.getTotalInodes(), ""), |
| 364 | 100d * fs.getFreeInodes() / fs.getTotalInodes(), fs.getVolume(), fs.getLogicalVolume(), |
| 365 | fs.getMount())); |
| 366 | } |
| 367 | } |
| 368 | |
| 369 | private static void printNetworkInterfaces(List<NetworkIF> list) { |
| 370 | StringBuilder sb = new StringBuilder("Network Interfaces:"); |
no test coverage detected