Package

com.swoval

files

Permalink

package files

Visibility
  1. Public
  2. All

Type Members

  1. class AppleFileEventStreams extends LockableMap[Path, Stream]

    Permalink
  2. class ApplePathWatcher extends PathWatcher[Event]

    Permalink

    Implements the PathWatcher for Mac OSX using the Apple File System Events Api.

  3. class CacheObservers[T] extends CacheObserver[T] with AutoCloseable

    Permalink
  4. trait CachedDirectory[T <: AnyRef] extends UpdatableFileTreeDataView[T] with DirectoryDataView[T] with AutoCloseable

    Permalink
  5. class CachedDirectoryImpl[T <: AnyRef] extends CachedDirectory[T]

    Permalink

    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 < 0 means 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.

  6. trait DebugLogger extends Logger

    Permalink
  7. trait DirectoryDataView[T <: AnyRef] extends FileTreeDataView[T] with DirectoryView

    Permalink
  8. trait DirectoryLister extends AnyRef

    Permalink
  9. trait DirectoryRegistry extends Filter[Path] with AutoCloseable

    Permalink

    Tracks which directories the user wishes to monitor.

    Tracks which directories the user wishes to monitor. This can be used to determine whether or not a path is part of the subtree specified by the set of paths registered by the user.

  10. class DirectoryRegistryImpl extends DirectoryRegistry

    Permalink
  11. trait DirectoryView extends FileTreeView

    Permalink

    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.

  12. class FileCacheDirectories[T <: AnyRef] extends LockableMap[Path, CachedDirectory[T]]

    Permalink
  13. class FileCacheDirectoryTree[T <: AnyRef] extends ObservableCache[T] with FileTreeDataView[T]

    Permalink
  14. class FileCachePathWatcher[T <: AnyRef] extends AutoCloseable

    Permalink
  15. class FileCachePendingFiles extends Lockable

    Permalink
  16. trait FileTreeDataView[T <: AnyRef] extends FileTreeView with AutoCloseable

    Permalink

    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

  17. trait FileTreeRepository[T <: AnyRef] extends FileTreeDataView[T] with PathWatcher[Entry[T]] with ObservableCache[T] with AutoCloseable

    Permalink

    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 ls tool. 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

  18. class FileTreeRepositoryImpl[T <: AnyRef] extends FileTreeRepository[T]

    Permalink
  19. trait FileTreeView extends AutoCloseable

    Permalink
  20. trait Function[T, R] extends AnyRef

    Permalink

    Functional interface for a function that takes one argument.

  21. class Lockable extends AnyRef

    Permalink
  22. class LockableMap[K, V] extends Lockable

    Permalink
  23. class NioDirectoryLister extends DirectoryLister

    Permalink
  24. class NioPathWatcher extends PathWatcher[Event] with AutoCloseable

    Permalink

    Provides a PathWatcher that is backed by a java.nio.file.WatchService.

  25. class Observers[T] extends Observer[T] with AutoCloseable

    Permalink

    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

  26. trait PathWatcher[T] extends Observable[T] with AutoCloseable

    Permalink

    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.

  27. class PollingPathWatcher extends PathWatcher[Event]

    Permalink
  28. trait RegisterableWatchService extends WatchService

    Permalink

    Augments the java.nio.file.WatchService with a RegisterableWatchService.register method.

  29. class RegisteredPaths extends LockableMap[Path, RegisteredPath]

    Permalink
  30. class RootDirectories extends LockableMap[Path, CachedDirectory[WatchedDirectory]]

    Permalink
  31. class SimpleFileTreeView extends FileTreeView

    Permalink
  32. class SymlinkFollowingPathWatcher extends PathWatcher[Event]

    Permalink
  33. class SymlinkWatcher extends Observable[Event] with AutoCloseable

    Permalink

    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.

  34. trait TotalFunction[T, R] extends Function[T, R]

    Permalink
  35. trait TypedPath extends AnyRef

    Permalink

    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.

  36. trait UpdatableFileTreeDataView[T <: AnyRef] extends AnyRef

    Permalink
  37. trait WatchedDirectory extends AutoCloseable

    Permalink

Ungrouped