Package com.swoval.files
Interface FileTreeView
-
- All Superinterfaces:
java.lang.AutoCloseable
- All Known Subinterfaces:
DirectoryView,FileTreeDataView<T>,FileTreeRepository<T>
public interface FileTreeView extends java.lang.AutoCloseableLists 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 inFileTreeViewsincluding 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 thepath, returning only those files that are accepted by the provided filter.
-
-
-
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 thepath, returning only those files that are accepted by the provided filter.- Parameters:
path- the root path to listmaxDepth- the maximum depth of subdirectories to queryfilter- include only paths accepted by the filter- Returns:
- a List of
Pathinstances accepted by the filter. - Throws:
java.io.IOException- if the path cannot be listed.
-
-