package files
- Alphabetic
- Public
- All
Type Members
- class AppleFileEventStreams extends LockableMap[Path, Stream]
-
class
ApplePathWatcher extends PathWatcher[Event]
Implements the PathWatcher for Mac OSX using the Apple File System Events Api.
- class CacheObservers[T] extends CacheObserver[T] with AutoCloseable
- trait CachedDirectory[T <: AnyRef] extends UpdatableFileTreeDataView[T] with DirectoryDataView[T] with AutoCloseable
-
class
CachedDirectoryImpl[T <: AnyRef] extends CachedDirectory[T]
Provides a mutable in-memory cache of files and subdirectories with basic CRUD functionality.
Provides a mutable in-memory cache of files and subdirectories with basic CRUD functionality. The CachedDirectory can be fully recursive as the subdirectories are themselves stored as recursive (when the CachedDirectory is initialized without the recursive toggle, the subdirectories are stored as Entry instances. The primary use case is the implementation of FileTreeRepository and NioPathWatcher. Directly handling CachedDirectory instances is discouraged because it is inherently mutable so it's better to let the FileTreeRepository manage it and query the cache rather than CachedDirectory directly.
The CachedDirectory should cache all of the files and subdirectories up the maximum depth. A maximum depth of zero means that the CachedDirectory should cache the subdirectories, but not traverse them. A depth
< 0means that it should not cache any files or subdirectories within the directory. In the event that a loop is created by symlinks, the CachedDirectory will include the symlink that completes the loop, but will not descend further (inducing a loop).- T
the cache value type.
- trait DirectoryDataView[T <: AnyRef] extends FileTreeDataView[T] with DirectoryView
- trait DirectoryLister extends AnyRef
- trait DirectoryRegistry extends Filter[Path] with AutoCloseable
- class DirectoryRegistryImpl extends DirectoryRegistry
-
trait
DirectoryView extends FileTreeView
A repository for a directory.
A repository for a directory. The FileTreeView.list method will only return non-empty results for paths that are children of the root directory, specified by DirectoryView.getTypedPath.
- class FileCacheDirectories[T <: AnyRef] extends LockableMap[Path, CachedDirectory[T]]
- class FileCacheDirectoryTree[T <: AnyRef] extends ObservableCache[T] with FileTreeDataView[T]
- class FileCachePathWatcher[T <: AnyRef] extends AutoCloseable
- class FileCachePendingFiles extends Lockable
-
trait
FileTreeDataView[T <: AnyRef] extends FileTreeView with AutoCloseable
A repository for which each java.nio.file.Path has an associated data value.
A repository for which each java.nio.file.Path has an associated data value.
- T
the data value for each path
-
trait
FileTreeRepository[T <: AnyRef] extends FileTreeDataView[T] with PathWatcher[Entry[T]] with ObservableCache[T] with AutoCloseable
Provides an in memory cache of portions of the file system.
Provides an in memory cache of portions of the file system. Directories are added to the cache using the FileTreeRepository.register method. Once a Path is added the cache, its contents may be retrieved using the FileTreeRepository.list method. The cache stores the path information in Entry instances.
A default implementation is provided by FileTreeRepositories.get. The user may cache arbitrary information in the cache by customizing the Converter that is passed into the factory FileTreeRepositories.get.
The cache allows the user to register a regular file, directory or symbolic link. After registration, the cache should monitor the path (and in the case of symbolic links, the target of the link) for updates. Whenever an update is detected, the cache updates its internal representation of the file system. When that is complete, it will notify all of the registered com.swoval.files.Observers of the change. In general, the update that is sent in the callback will be visible if the user lists the relevant path. It is however, possible that if the file is being updated rapidly that the internal state of the cache may change in between the callback being invoked and the user listing the path. Once the file system activity settles down, the cache should always end up in a consistent state where it mirrors the state of the file system.
The semantics of the list method are very similar to the linux
lstool. Listing a directory returns all of the subdirectories and files contained in the directory and the empty list if the directory is empty. Listing a file, however, will return the entry for the file if it exists and the empty list otherwise.- T
the type of data stored in the Entry instances for the cache
- class FileTreeRepositoryImpl[T <: AnyRef] extends FileTreeRepository[T]
- trait FileTreeView extends AutoCloseable
-
trait
Function[T, R] extends AnyRef
Functional interface for a function that takes one argument.
- class Lockable extends AnyRef
- class LockableMap[K, V <: AutoCloseable] extends Lockable
- class NioDirectoryLister extends DirectoryLister
-
class
NioPathWatcher extends PathWatcher[Event] with AutoCloseable
Provides a PathWatcher that is backed by a java.nio.file.WatchService.
-
class
Observers[T] extends Observer[T] with AutoCloseable
Container class that wraps multiple FileTreeViews.Observer and runs the callbacks for each whenever the PathWatcher detects an event.
Container class that wraps multiple FileTreeViews.Observer and runs the callbacks for each whenever the PathWatcher detects an event.
- T
the data type for the PathWatcher to which the observers correspond
-
trait
PathWatcher[T] extends Observable[T] with AutoCloseable
Watches directories for file changes.
Watches directories for file changes. The api permits recursive watching of directories unlike the java.nio.file.WatchService. Some of the behavior may vary by platform due to fundamental differences in the underlying file event apis. For example, Linux doesn't support recursive directory monitoring via inotify, so it's possible in rare cases to miss file events for newly created files in newly created directories. On OSX, it is difficult to disambiguate file creation and modify events, so the Event.Kind is best effort, but should not be relied upon to accurately reflect the state of the file.
- class PollingPathWatcher extends PathWatcher[Event]
-
trait
RegisterableWatchService extends WatchService
Augments the java.nio.file.WatchService with a RegisterableWatchService.register method.
Augments the java.nio.file.WatchService with a RegisterableWatchService.register method. This is because https://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html.register does not work on custom watch services.
- class RegisteredPaths extends LockableMap[Path, RegisteredPath]
- class RootDirectories extends LockableMap[Path, CachedDirectory[WatchedDirectory]]
- class SimpleFileTreeView extends FileTreeView
- class SymlinkFollowingPathWatcher extends PathWatcher[Event]
-
class
SymlinkWatcher extends Observable[Event] with AutoCloseable
Monitors symlink targets.
Monitors symlink targets. The SymlinkWatcher maintains a mapping of symlink targets to symlink. When the symlink target is modified, the watcher will detect the update and invoke a provided com.swoval.functional.Consumer for the symlink.
- trait TotalFunction[T, R] extends Function[T, R]
-
trait
TypedPath extends AnyRef
A mix-in for an object that represents a file system path.
A mix-in for an object that represents a file system path. Provides (possibly) fast accessors for the type of the file.
- trait UpdatableFileTreeDataView[T <: AnyRef] extends AnyRef
- trait WatchedDirectory extends AutoCloseable
Value Members
- object ApplePathWatcher
- object ApplePathWatchers
- object ArrayOps
- object CacheObservers
- object CachedDirectoryImpl
- object DirectoryListers
- object DirectoryRegistries
- object DirectoryRegistryImpl
- object Entries
- object Executor
- object FileTreeDataViews
- object FileTreeRepositories
- object FileTreeRepositoryImpl
- object FileTreeViews
- object MapOps
- object PathWatchers
- object SimpleFileTreeView
- object SymlinkWatcher
- object TypedPaths
- object WatchedDirectories