public void dfInfo() throws SigarException {
clearInfo();
println("============Report filesystem disk space usage===============");
try {
sigarInit(true);
FileSystem[] fslist = ();
String[] HEADER = new String[] {
"Filesystem",
"Size",
"Used",
"Avail",
"Use%",
"Mounted on",
"Type"
};
printf(" ls ls ls ls ls ls ls",HEADER);
for (int i=0; i<; i++) {
singleFsInfo(fslist[i]);
}
} catch (RuntimeException e) {
// TODO Auto-generated catch block
();
} finally {
shutdown();
}
}
public void singleFsInfo(FileSystem fs) throws SigarException {
long used, avail, total, pct;
try {
FileSystemUsage usage;
if (fs instanceof NfsFileSystem) {
NfsFileSystem nfs = (NfsFileSystem)fs;
if (!()) {
println(());
return;
}
}
usage = (());
used = () - ();
avail = ();
total = ();
pct = (long)(() * 100);
} catch (SigarException e) {
//. on win32 D:\ fails with "Device not ready"
//if there is no cd in the drive.
used = avail = total = pct = 0;
}
String usePct;
if (pct == 0) {
usePct = "-";
}
else {
usePct = pct + "%";
}
Object[] items = new Object[] {
(),
(total* 1024),
(used* 1024),
(avail* 1024),
usePct,
(),
() + "/" + ()
};
printf(" ls ls ls ls ls ls ls",items);
}