Package com.swoval.files
Class FileTreeDataViews
- java.lang.Object
-
- com.swoval.files.FileTreeDataViews
-
public class FileTreeDataViews extends java.lang.ObjectProvides functional interfaces for processing and managing instances ofFileTreeDataView.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFileTreeDataViews.CacheObserver<T>Provides callbacks to run when different types of file events are detected by the cache.static interfaceFileTreeDataViews.Converter<R>Converts a Path into an arbitrary value to be cached.static interfaceFileTreeDataViews.Entry<T>Container class forCachedDirectoryImplentries.static interfaceFileTreeDataViews.ObservableCache<T>A file tree cache that can be monitored for events.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> com.swoval.files.DirectoryDataView<T>cached(java.nio.file.Path path, FileTreeDataViews.Converter<T> converter, int depth, boolean followLinks)Make a newDirectoryViewthat caches the file tree but has no data value associated with each value.
-
-
-
Method Detail
-
cached
public static <T> com.swoval.files.DirectoryDataView<T> cached(java.nio.file.Path path, FileTreeDataViews.Converter<T> converter, int depth, boolean followLinks) throws java.io.IOExceptionMake a newDirectoryViewthat caches the file tree but has no data value associated with each value.- Type Parameters:
T- the data type for this view- Parameters:
path- the path to monitorconverter- computes the data value for each path found in the directorydepth- 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 files- Returns:
- a directory whose entries just contain the path itself.
- Throws:
java.io.IOException- when an error is encountered traversing the directory.
-
-