Here you can find the source of getFilesize(String filepath)
public static Double getFilesize(String filepath)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static Double getFilesize(String filepath) { File backupath = new File(filepath); return Double.valueOf(backupath.length()) / 1000.000; }// w w w .j av a 2 s .co m }