I'm reading about jakarta commons IO FileSystemUtils class.
It has the method freeSpaceKb:
public static long freeSpaceKb(
String path)
throws IOException
Returns the free space on a drive or volume in kilobytes by invoking the command line.
FileSystemUtils.freeSpaceKb("C:"); // Windows
FileSystemUtils.freeSpaceKb("/volume"); // *nix
The free space is calculated via the command line. It uses 'dir /-c' on Windows, 'df -kP' on AIX/HP-UX and 'df -k' on other Unix.
In order to work, you must be running Windows, or have a implementation of Unix df that supports GNU format when passed -k (or -kP).
(from
http://commons.apache.org/io/api-release/index.html?org/apache/commons/io/FileSystemUtils.html )
ALSO:
SIGAR (
http://support.hyperic.com/display/SIGAR/Home )
System Information Gatherer And Reporter
looks full of features for querying system resources, but I've never used it.