How to get file size in java code, example?
How to get file size in java code, example
Now we are writing a very simple code for find the file size in java.
Copy and paste this code in your java class.
public static long getFileSize(String filePath)
{
File f = new File(filePath);
return f.length();
}
Now we are writing a very simple code for find the file size in java.
Copy and paste this code in your java class.
public static long getFileSize(String filePath)
{
File f = new File(filePath);
return f.length();
}
Comments
Post a Comment