Interface FileTreeView

  • All Superinterfaces:
    java.lang.AutoCloseable
    All Known Subinterfaces:
    DirectoryView, FileTreeDataView<T>, FileTreeRepository<T>

    public interface FileTreeView
    extends java.lang.AutoCloseable
    Lists all of the children of a particular directory up to a specified depth. It provides an alternative to `java.nio.file.Files.walkFileTree` or `java.nio.file.Files.list` to recursively list the contents of a directory. Implementations are provided in FileTreeViews including native implementations for most popular platforms that can outperform the java built-ins.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.util.List<TypedPath> list​(java.nio.file.Path path, int maxDepth, Filter<? super TypedPath> filter)
      List all of the files for the path, returning only those files that are accepted by the provided filter.
      • Methods inherited from interface java.lang.AutoCloseable

        close
    • Method Detail

      • list

        java.util.List<TypedPath> list​(java.nio.file.Path path,
                                       int maxDepth,
                                       Filter<? super TypedPath> filter)
                                throws java.io.IOException
        List all of the files for the path, returning only those files that are accepted by the provided filter.
        Parameters:
        path - the root path to list
        maxDepth - the maximum depth of subdirectories to query
        filter - include only paths accepted by the filter
        Returns:
        a List of Path instances accepted by the filter.
        Throws:
        java.io.IOException - if the path cannot be listed.