public abstract DirectoryStream<Path> newDirectoryStream (Path dir, Filter<? super Path> filter) throws IOException

Opens a directory, returning a DirectoryStream to iterate over the entries in the directory. This method works in exactly the manner specified by the Files.newDirectoryStream(java.nio.file.Path, java.nio.file.DirectoryStream.Filter) method.

dir     the path to the directory
filter     the directory stream filter

Returns:  a new and open DirectoryStream object

NotDirectoryException     if the file could not otherwise be opened because it is not a directory (optional specific exception)
IOException     if an I/O error occurs
SecurityException     In the case of the default provider, and a security manager is installed, the checkRead method is invoked to check read access to the directory.