Package com.swoval.files
Provides classes for monitoring directories for file system updates. The
PathWatcher
provides a raw api to monitor directories for file events. The
FileTreeRepository
generates an in memory cache of a set of directories
that can be listed. The cache can store arbitrary user data that is returned to the user whenever
the cache is listed or fires a callback (see FileTreeDataViews.CacheObserver
).
The implementation of all of the classes in this package uses only apis and code constructs that can be translated by scalagen. This can cause some of the code to look a bit awkward or not be quite idiomatic java.
-
Interface Summary Interface Description DirectoryView A repository for a directory.FileTreeDataView<T> A repository for which eachPath
has an associated data value.FileTreeDataViews.CacheObserver<T> Provides callbacks to run when different types of file events are detected by the cache.FileTreeDataViews.Converter<R> Converts a Path into an arbitrary value to be cached.FileTreeDataViews.Entry<T> Container class forCachedDirectoryImpl
entries.FileTreeDataViews.ObservableCache<T> A file tree cache that can be monitored for events.FileTreeRepository<T> Provides an in memory cache of portions of the file system.FileTreeView Lists all of the children of a particular directory up to a specified depth.FileTreeViews.Observable<T> Provides an api for subscribing and unsubscribing to events.FileTreeViews.Observer<T> Generic Observer for anFileTreeViews.Observable
.PathWatcher<T> Watches directories for file changes.RegisterableWatchService Augments the java.nio.file.WatchService with aRegisterableWatchService.register(java.nio.file.Path, java.nio.file.WatchEvent.Kind<?>...)
method.TypedPath A mix-in for an object that represents a file system path. -
Class Summary Class Description FileTreeDataViews Provides functional interfaces for processing and managing instances ofFileTreeDataView
.FileTreeRepositories Provides factory methods for generating instances ofFileTreeRepository
.FileTreeViews Provides static methods returning instances of the various view interfaces defined throughout this package.PathWatchers Provides factory methods to create instances ofPathWatcher
.PathWatchers.Event Container forPathWatcher
events.PathWatchers.Event.Kind An enum like class to indicate the type of file event.RegisterableWatchServices Provides a platform dependent implementation ofRegisterableWatchService
.TypedPaths Provides a defaultTypedPath
implementation.