Directory listing with the NIO.2 API

The NIO.2 (“New Input/Output 2”) is a new API introduced in JDK 7 to operate more efficiently and uniformly on file systems. This new API covers many file and directory-specific aspects, such as handling attributes and symbolic links. This article discusses one of the most straightforward aspects of NIO.2, listing directory entries using the new DirectoryStream…