Java File Exist FileExists(String filePath)

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

Description

Indicates whether a file exists (and is not a directory).

License

Open Source License

Parameter

Parameter Description
filePath Absolute file path

Exception

Parameter Description
Exception an exception

Return

Whether the file exists (and is not a directory)

Declaration

public static boolean FileExists(String filePath) throws Exception 

Method Source Code

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

import java.io.File;

public class Main {
    /** Indicates whether a file exists (and is not a directory).
     */*from  w w  w.j  a  v  a2s  . com*/
     * @param filePath Absolute file path
     * @return Whether the file exists (and is not a directory)
     * @throws Exception
     */
    public static boolean FileExists(String filePath) throws Exception {
        File file = new File(filePath);
        return file.exists() && !file.isDirectory();
    }
}

Related

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