Java File Exist isFileExists(String filePath)

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

Description

determines the existence of file

License

Apache License

Parameter

Parameter Description
filePath a parameter

Declaration

public static boolean isFileExists(String filePath) 

Method Source Code

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

import java.io.File;

public class Main {
    public static String LAST_ERROR = "";

    /**/*from w w  w  .  j a va  2s  . c  o m*/
     * determines the existence of file 
     * @param filePath
     * @return
     */
    public static boolean isFileExists(String filePath) {
        try {
            return new File(filePath).exists();
        } catch (Exception e) {
            LAST_ERROR = e.getMessage();
            e.printStackTrace();
            return false;
        }
    }
}

Related

  1. isFileExistent(String path)
  2. isFileExistNotCreate(String fileNameAndPath)
  3. isFileExists(String f, String ext)
  4. isFileExists(String filepath)
  5. isFileExists(String filePath)
  6. isFileExists(String filePathString)