Apache Commons IO Tutorial
Selected Reading
- Apache Commons IO - Discussion
- Apache Commons IO - Useful Resources
- Apache Commons IO - Quick Guide
- Apache Commons IO - TeeOutputStream
- Apache Commons IO - TeeInputStream
- LastModifiedFileComparator
- Apache Commons IO - SizeFileComparator
- Apache Commons IO - NameFileComparator
- Apache Commons IO - FileAlterationMonitor
- Apache Commons IO - FileAlterationObserver
- Apache Commons IO - FileEntry
- Apache Commons IO - AndFileFilter
- Apache Commons IO - OrFileFilter
- Apache Commons IO - PrefixFileFilter
- Apache Commons IO - SuffixFileFilter
- Apache Commons IO - WildcardFileFilter
- Apache Commons IO - NameFileFilter
- Apache Commons IO - LineIterator
- Apache Commons IO - IOCase
- Apache Commons IO - FileSystemUtils
- Apache Commons IO - FilenameUtils
- Apache Commons IO - FileUtils
- Apache Commons IO - IOUtils
- Apache Commons IO - Environment Setup
- Apache Commons IO - Overview
- Apache Commons IO - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
Apache Commons IO - FileSystemUtils
Apache Commons IO - FileSystemUtils
FileSystemUtils provide method to get the free space on a disk drive.
Class Declaration
Following is the declaration for org.apache.commons.io.FileSystemUtils Class −
pubpc class FileSystemUtils extends Object
Example of FileSystemUtils Class
Given below is the example of FileSystemUtils Class −
IOTester.java
import java.io.IOException; import org.apache.commons.io.FileSystemUtils; pubpc class IOTester { pubpc static void main(String[] args) { try { System.out.println("Free Space " + FileSystemUtils.freeSpaceKb("C:/") + " Bytes"); } catch(IOException e) { System.out.println(e.getMessage()); } } }
Output
It will print the following result −
Free Space 61355640 kbAdvertisements