Here you can find the source of getFilesize(String address)
public static long getFilesize(String address) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; public class Main { public static long getFilesize(String address) throws IOException { File file = new File(address); if (file.exists()) { return file.length(); } else {//w ww. j av a2 s . c o m return 0; } } }