Java File Size Get getFilesize(String address)

Here you can find the source of getFilesize(String address)

Description

get Filesize

License

Open Source License

Declaration

public static long getFilesize(String address) throws IOException 

Method Source Code

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

Related

  1. getFileSize(final String filePath)
  2. getFileSize(final String path)
  3. getFileSize(InputStream inputStream)
  4. getFileSize(int fileSize)
  5. getFileSize(long fileSize)
  6. getFileSize(String fileName)
  7. getFileSize(String filename)
  8. getFileSize(String filename)
  9. getFileSize(String fileName, Logger log)