Java File Size Get getFileSize(String fn)

Here you can find the source of getFileSize(String fn)

Description

get File Size

License

Apache License

Declaration

public static long getFileSize(String fn) 

Method Source Code


//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*/
}

Related

  1. getFileSize(String filepath)
  2. getFilesize(String filepath)
  3. getFileSize(String filePath)
  4. getFileSize(String filePath)
  5. getFileSize(String fileSize)
  6. getFileSize(String loc)
  7. getFileSize(String path)
  8. getFileSize(String path)
  9. getFilesize(String path)