private static List < Path > file_listing_ ( Path dir ) throws IOException { try ( Stream < Path > files = Files . list ( dir ) ) { return files . collect ( Collectors . toList ( ) ) ; } }
Scan a directory for files . This method reads the entire stream and closes it immediately .