The isDirectory() method tests whether the file provided is a directory.
2. Method signature
- method does not take any parameter
- true - if the file indicated by this abstract pathname exists and is a directory
- SecurityException - when we do not have access to the file or directory
3.1. Program that checks if
/tmp/frontbackend/ are directories
In this article, we presented
File.isDirectory the method that checks if given
File is a directory in the filesystem. Consider using
Files.readAttributes() method if you need to distinguish an I/O exception from the case that the file is not a directory.