Here you can find the source of getFileSize(String fn)
public static long getFileSize(String fn)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { public static long getFileSize(String fn) { File f = new File(fn); if (!f.exists()) return 0; return f.length(); }/*from ww w .j a v a2s .c o m*/ }