File file = new File("C:\Windows"); // Directory if(file.isDirectory() == true) { System.out.println("Directory!!"); }