Java tutorial
//package com.java2s; import java.io.File; import java.io.FileInputStream; public class Main { public static long getFileSizes(File f) { long s = 0; try { if (f.exists()) { FileInputStream fis = null; fis = new FileInputStream(f); s = fis.available(); } } catch (Exception ex) { ex.printStackTrace(); } return s; } }