Here you can find the source of exists(String fileName)
public static boolean exists(String fileName)
//package com.java2s; import java.io.File; public class Main { public static boolean exists(String fileName) { return exists(new File(fileName)); }/*from w ww. ja v a 2 s . co m*/ public static boolean exists(File file) { return file.exists(); } }