p

com.swoval

files

package files

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. class AppleFileEventStreams extends LockableMap[Path, Stream]
  2. class ApplePathWatcher extends PathWatcher[Event]

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

  3. class CacheObservers[T] extends CacheObserver[T] with AutoCloseable
  4. trait CachedDirectory[T <: AnyRef] extends UpdatableFileTreeDataView[T] with DirectoryDataView[T] with AutoCloseable
  5. 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 < 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 DirectoryDataView[T <: AnyRef] extends FileTreeDataView[T] with DirectoryView
  7. trait DirectoryLister extends AnyRef
  8. trait DirectoryRegistry extends Filter[Path] with AutoCloseable
  9. class DirectoryRegistryImpl extends DirectoryRegistry
  10. 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.

  11. class FileCacheDirectories[T <: AnyRef] extends LockableMap[Path, CachedDirectory[T]]
  12. class FileCacheDirectoryTree[T <: AnyRef] extends ObservableCache[T] with FileTreeDataView[T]
  13. class FileCachePathWatcher[T <: AnyRef] extends AutoCloseable
  14. class FileCachePendingFiles extends Lockable
  15. 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

  16. 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 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

  17. class FileTreeRepositoryImpl[T <: AnyRef] extends FileTreeRepository[T]
  18. trait FileTreeView extends AutoCloseable
  19. trait Function[T, R] extends AnyRef

    Functional interface for a function that takes one argument.

  20. class Lockable extends AnyRef
  21. class LockableMap[K, V <: AutoCloseable] extends Lockable
  22. class NioDirectoryLister extends DirectoryLister
  23. class NioPathWatcher extends PathWatcher[Event] with AutoCloseable

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

  24. 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

  25. 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.

  26. class PollingPathWatcher extends PathWatcher[Event]
  27. trait RegisterableWatchService extends WatchService

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

  28. class RegisteredPaths extends LockableMap[Path, RegisteredPath]
  29. class RootDirectories extends LockableMap[Path, CachedDirectory[WatchedDirectory]]
  30. class SimpleFileTreeView extends FileTreeView
  31. class SymlinkFollowingPathWatcher extends PathWatcher[Event]
  32. 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.

  33. trait TotalFunction[T, R] extends Function[T, R]
  34. 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.

  35. trait UpdatableFileTreeDataView[T <: AnyRef] extends AnyRef
  36. trait WatchedDirectory extends AutoCloseable

Ungrouped