Java tutorial
import java.io.File; public class Main { public static void main(String[] args) { File file = new File("C://FileIO"); boolean isFile = file.isFile(); if (isFile) { System.out.println("a file."); } else { System.out.println("not a file."); } boolean isDirectory = file.isDirectory(); if (isDirectory) { System.out.println("a directory."); } else { System.out.println("not a directory."); } } }