Java examples for File Path IO:Path
Determining If a Filename Path Is a File or a Directory
import java.awt.Graphics; import java.io.File; public class Main { public void m() { File dir = new File("directoryName"); boolean isDir = dir.isDirectory(); if (isDir) {/* w w w . j a v a 2s . c o m*/ // dir is a directory } else { // dir is a file } } }