Contact at or 8097636691
Responsive Ads Here

Friday, 29 June 2018

Apache Commons IO - FileSystemUtils

Apache Commons IO - FileSystemUtils

Provides method to get the free space on a disk drive.

Class Declaration

Following is the declaration for Class −
public class FileSystemUtils
   extends Object

Example of FileSystemUtils Class


public class IOTester {
   public static void main(String[] args) {
      try {
         System.out.println("Free Space " + FileSystemUtils.freeSpaceKb("C:/") + " Bytes");
      } catch(IOException e) {


It will print the following result.
Free Space 61355640 kb

No comments:

Post a Comment