Here you can find the source of fileExists(String path)
public static boolean fileExists(String path)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static boolean fileExists(String path) { try {// w w w. j a va 2 s . com File f = new File(path); return f.exists() && f.isFile(); } catch (Exception e) { throw new RuntimeException("Checking if file exists failed", e); } } }