At times we might want to search for some file in a directory traversing recursively into other directories with in that directory, I know getting the recursive program right at the first time is always a challenge. Or we might want to list all the contents of a directory. For all these operations the NIO2 …
nio2
Listing and filtering directory content using Java NIO2
The Files class provides a method- newDirectoryStream to get the Directory contents for a give path instance. There are other overloaded versions of newDirectoryStream method which take in filters to apply on the directory content. also read: Java 7.0 Tutorials New Features in Java 7.0 G1 Garbage Collector in Java 7.0 Listing all files in …