Here you can find the source of getFileSize(String path)
Parameter | Description |
---|
public static long getFileSize(String path)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { public static long getFileSize(String path) { File file = new File(path); if (file.isFile() && file.exists()) { return file.length(); }/*from ww w . j a v a 2 s . co m*/ return 0; } }