If you could tell us what you need exactly, we could come up with a simpler example of how to use the FileSystem classes. For example, the following lists the bytes available for all file systems:
import org.hyperic.sigar.*;
public class df {
public static void main(String[] args) throws Exception {
Sigar sigar = new Sigar();
for (FileSystem fs : sigar.getFileSystemList()) {
FileSystemUsage usage;
try {
usage = sigar.getFileSystemUsage(fs.getDirName());
} catch (SigarException e) {
continue;
}
System.out.println(fs.getDirName() + " bytes available: " + usage.getAvail());
}
}
}
|