dcsimg

Is there a way in Java to find out the available free space on a disk drive?

John Zukowski

Prior to Java 6, short of using JNI, there was no built in support.

With Java 6, you can use the new methods of the File class: getUsableSpace() and getTotalSpace().