How to get free space of a drive or volume?
getFreeSpaceKb(String path) method call of the
FileSystemUtils class can help you to calculate the free space of a drive or volume in kilo bytes.
commons io solution, you can use the
File.getFreeSpace() method call provided in the Java 1.6 API. You can find an example of it in the following link: How to get total space and free space of my disk?.
An example result of the code above is:
Free space of C: = 121961228 KB
Free space of C: = 119102 MB
Free space of C: = 116 GB