code: private static List<Path> file_listing_(Path dir) throws IOException {
          try (Stream<Path> files = Files.list(dir)) {
              return files.collect(Collectors.toList());
          }
      }
docs: Scan a directory for files. This method reads the entire stream and
  closes it immediately.
  
  @param dir The directory to scan for files.
  @throws IOException if the directory cannot be listed.