Java File Exist fileExists(String filePath)

Here you can find the source of fileExists(String filePath)

Description

file Exists

License

Open Source License

Declaration

public static boolean fileExists(String filePath) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.File;

public class Main {
    public static boolean fileExists(String filePath) {
        if (null == filePath || "".equals(filePath.trim())) {
            throw new IllegalArgumentException("File Path cannot be Null/Empty");
        }//from   w w w .ja  v  a 2  s  .c om
        File file = new File(filePath);
        if (!file.exists()) {
            return false;
        }
        return true;
    }
}

Related

  1. fileExists(String filename)
  2. FileExists(String filename)
  3. fileExists(String fileName)
  4. fileExists(String fileName)
  5. fileExists(String filepath)
  6. FileExists(String filePath)
  7. fileExists(String filePathString)
  8. fileExists(String fName)
  9. fileExists(String folderPath, String fileName)