code: @Nonnull
      public static List<Path> list(@Nonnull final Path dir) throws IOException {
          final List<Path> contents = new ArrayList<>();
          try (final DirectoryStream<Path> stream = Files.newDirectoryStream(dir)) {
              for (final Path entry : stream) {
                  contents.add(entry);
              }
          } catch (DirectoryIteratorException ex) {
              // I/O error encounted during the iteration, the cause is an IOException
              throw ex.getCause();
          }
          return contents;
      }
docs: Convenience method to return all paths in a SMALL directory.
  <p/>
  DO NOT USE THIS TO TRAVERSE LARGE (multi-thousand inode) DIRECTORIES!
  <p/>
  For starters you shouldn't be making directories that big at all, but if you did please use
  {@link Files#newDirectoryStream(Path)} directly in your code.
  
  @param dir directory to evaluate
  @return all files in that directory
  @throws IOException