private static List<Path> file_listing_(Path dir) throws IOException {
  try (Stream<Path> files=Files.list(dir)){
    return files.collect(Collectors.toList());
  }
 }

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 .
