Java File Size Get getFileSize2(String filename)

Here you can find the source of getFileSize2(String filename)

Description

get File Size

License

Apache License

Declaration

public static long getFileSize2(String filename) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.File;

public class Main {
    public static long getFileSize2(String filename) {
        File file = new File(filename);
        return file.length();
    }// w  ww  . jav  a  2s  .c om

    public static long getFileSize2(String filename, String dir) {
        File file = new File(dir, filename);
        return file.length();
    }
}

Related

  1. getFileSize(String fn)
  2. getFileSize(String loc)
  3. getFileSize(String path)
  4. getFileSize(String path)
  5. getFilesize(String path)
  6. getFileSizeAggregate(String[] files)
  7. getFileSizeFormat(double inputvalue)
  8. getFileSizeFormat(String total_size)
  9. getFileSizeLabel(long sizeInBytes)