In java, you can use class java.io.File to get file size. Just see the example:

import java.io.*;

public class FileSize {
	public static void main(String args[]) {
		File file = new File("C:/test.txt");
		long fSize = file.length();
		long fSizeInKB = fSize / 1024;
		System.out.println("Size of File is: " + fSizeInKB + " KB");
	}
}

Its easy:mrgreen: