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 }
All the Code Snippets and Samples you need
To check if a path is a file or folder in Java you can use the following snippet.
File path = new File("File or DirectoryName"); boolean isDir = path.isDirectory(); if (isDir) { // its a directory } else { // its a file }
You must be logged in to post a comment.
RT @CodeSnippetsNET: Check if path is file or folder in #Java http://t.co/Cpw3WsuJTf #programming #code