In Java there is nothing to do with hadware or Operating System. You can only find the No. of bytes in a File not in terms of disk space. The only way is to write Operating System Specific code (in C Language)to find out the file size and access the code using JNI from Java.