Java examples for File Path IO:Directory
Determine if file or directory exists
import java.io.*; public class Main { public static void main(String[] args) { File file = new File("C:/Folder/Demo.txt"); boolean blnExists = file.exists(); //ww w. ja v a 2 s . c o m System.out.println("Does file " + file.getPath() + " exist ?: " + blnExists); } }