How to get the size of the file
807591Mar 24 2008 — edited Mar 24 2008Hi All,
I want to get the size of the file in terms of bytes. I used the following code it returns the value in long how can get it in bytes
import java.io.File;
public class ServerBackupCheck {
public static void main(String args[]){
File f = new File("C:/Program Files/Apache Software Foundation/Tomcat 5.5");
System.out.println(f.isDirectory());
System.out.println(f.getTotalSpace());
}
}
output:
--------
true
20964163584
regards,
Maheshwaran Devaraj