MCPcopy
hub / github.com/oshi/oshi / printFileSystem

Method printFileSystem

oshi-core/src/test/java/oshi/SystemInfoTest.java:348–367  ·  view source on GitHub ↗
(FileSystem fileSystem)

Source from the content-addressed store, hash-verified

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:");

Callers 1

mainMethod · 0.95

Calls 15

formatBytesMethod · 0.95
formatValueMethod · 0.95
getMaxFileDescriptorsMethod · 0.65
getFileStoresMethod · 0.65
getUsableSpaceMethod · 0.65
getTotalSpaceMethod · 0.65
getLogicalVolumeMethod · 0.65
getNameMethod · 0.65
getDescriptionMethod · 0.65
getTypeMethod · 0.65
getFreeInodesMethod · 0.65

Tested by

no test coverage detected