To check if a path is a file or folder in Java you can use the following snippet.
Sample Java
File path = new File("File or DirectoryName");
boolean isDir = path.isDirectory();
if (isDir) {
// its a directory
} else {
// its a file
}
RT @CodeSnippetsNET: Check if path is file or folder in #Java http://t.co/Cpw3WsuJTf #programming #code