use of com.serotonin.m2m2.module.definitions.settings.DiskInfoDefinition.DiskInfo in project ma-core-public by infiniteautomation.
the class DiskInfoDefinition method getValue.
@Override
public List<DiskInfo> getValue() {
FileSystem fs = FileSystems.getDefault();
List<DiskInfo> disks = new ArrayList<DiskInfo>();
for (Path root : fs.getRootDirectories()) {
try {
FileStore store = Files.getFileStore(root);
DiskInfo disk = new DiskInfo();
disk.setName(root.getRoot().toString());
disk.setTotalSpace(store.getTotalSpace());
disk.setUsableSpace(store.getUsableSpace());
disks.add(disk);
} catch (IOException e) {
}
}
return disks;
}
use of com.serotonin.m2m2.module.definitions.settings.DiskInfoDefinition.DiskInfo in project ma-core-public by MangoAutomation.
the class DiskInfoDefinition method getValue.
@Override
public List<DiskInfo> getValue() {
FileSystem fs = FileSystems.getDefault();
List<DiskInfo> disks = new ArrayList<DiskInfo>();
for (Path root : fs.getRootDirectories()) {
try {
FileStore store = Files.getFileStore(root);
DiskInfo disk = new DiskInfo();
disk.setName(root.getRoot().toString());
disk.setTotalSpace(store.getTotalSpace());
disk.setUsableSpace(store.getUsableSpace());
disks.add(disk);
} catch (IOException e) {
}
}
return disks;
}
Aggregations