public class FileTreeViews
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
FileTreeViews.Observable<T>
Provides an api for subscribing and unsubscribing to events.
|
static interface |
FileTreeViews.Observer<T>
Generic Observer for an
FileTreeViews.Observable. |
| Modifier and Type | Method and Description |
|---|---|
static DirectoryView |
cached(java.nio.file.Path path,
int depth,
boolean followLinks)
Make a new
DirectoryView that caches the file tree but has no data value associated
with each value. |
static FileTreeView |
getDefault(boolean followLinks)
Returns the default
FileTreeView for the runtime platform. |
static FileTreeView |
getNative(boolean followLinks)
Returns an instance of
FileTreeView that uses native jni functions to improve
performance compared to the FileTreeView returned by getNio(boolean). |
static FileTreeView |
getNio(boolean followLinks)
Returns an instance of
FileTreeView that uses only apis available in java.nio.file. |
static java.util.List<TypedPath> |
list(java.nio.file.Path path,
int maxDepth,
Filter<? super TypedPath> filter)
List the contents of a path.
|
public static DirectoryView cached(java.nio.file.Path path, int depth, boolean followLinks) throws java.io.IOException
DirectoryView that caches the file tree but has no data value associated
with each value.path - the path to monitordepth - sets how the limit for how deep to traverse the children of this directoryfollowLinks - sets whether or not to treat symbolic links whose targets as directories or
filesjava.io.IOException - when an error is encountered traversing the directory.public static FileTreeView getNio(boolean followLinks)
FileTreeView that uses only apis available in java.nio.file.
This may be used on platforms for which there is no native implementation of FileTreeView.followLinks - toggles whether or not to follow the targets of symbolic links to
directories.FileTreeView.public static FileTreeView getNative(boolean followLinks)
FileTreeView that uses native jni functions to improve
performance compared to the FileTreeView returned by getNio(boolean).followLinks - toggles whether or not to follow the targets of symbolic links to
directories.FileTreeView.public static FileTreeView getDefault(boolean followLinks)
FileTreeView for the runtime platform. If a native implementation
is present, it will be used. Otherwise, it will fall back to the java.nio.file based
implementation.followLinks - toggles whether or not to follow the targets of symbolic links to
directories.FileTreeView.public static java.util.List<TypedPath> list(java.nio.file.Path path, int maxDepth, Filter<? super TypedPath> filter) throws java.io.IOException
path - the path to list. If the path is a directory, return the children of this directory
up to the maxDepth. If the path is a regular file and the maxDepth is -1, the
path itself is returned. Otherwise an empty list is returned.maxDepth - the maximum depth of children to include in the resultsfilter - only include paths accepted by this filterList of TypedPathjava.io.IOException - if the Path doesn't exist