Here you can find the source of fileExists(String filePath)
public static boolean fileExists(String filePath)
//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; } }