Check Directory Empty Java
If you want to search directory and check if it is empty or not using java please have sample program below. We will use jdk 7 Files.newDirectoryStream open directory and use iterator to check if it is empty or not.
- Sample java program:
For more information about Files API please check oracle documentation here