Here you can find the source of isFileExist(File file, File folder)
public static boolean isFileExist(File file, File folder)
//package com.java2s; //License from project: Apache License import java.io.File; public class Main { public static boolean isFileExist(File file, File folder) { File[] files = folder.listFiles(); String fileName = file.getName(); for (File f : files) { if (fileName.equals(f.getName())) { return true; }//www . j a va2 s . c o m } return false; } public static boolean isFileExist(String fileName, File folder) { File[] files = folder.listFiles(); for (File f : files) { if (fileName.equals(f.getName())) { return true; } } return false; } }