@ParametersAreNonnullByDefault public abstract class FileSystemDriverBase extends Object implements FileSystemDriver
FileSystemDriver with some reasonable defaults
The (overridable) defaults are:
basic file attributes are
supported;UserPrincipalLookupServices or WatchServices (both relevant methods throw an UnsupportedOperationException);SeekableByteChannels;isSameFile(Path, Path) returns true if and only if both
arguments are equal.UnixLikeFileSystemDriverBase| Modifier and Type | Field and Description |
|---|---|
protected PathElementsFactory |
pathElementsFactory |
| Modifier | Constructor and Description |
|---|---|
protected |
FileSystemDriverBase(URI uri,
PathElementsFactory pathElementsFactory,
FileStore fileStore,
PathMatcherProvider pathMatcherProvider) |
| Modifier and Type | Method and Description |
|---|---|
FileStore |
getFileStore()
Get the
FileStore associated with this filesystem |
PathElementsFactory |
getPathElementsFactory()
Get the
PathElementsFactory associated with this filesystem |
PathMatcherProvider |
getPathMatcherProvider()
Get a
PathMatcher provider for this filesystem |
PathElements |
getRoot()
Get the root path elements for this filesystem
|
Set<String> |
getSupportedFileAttributeViews()
Get a non-modifiable set of file attribute views supported by this
filesystem
|
URI |
getUri()
Get the URI associated with this filesystem
|
UserPrincipalLookupService |
getUserPrincipalLookupService()
Get a user/group lookup service for this filesystem
|
boolean |
isSameFile(Path path,
Path path2)
Tell whether two paths actually refer to the same resource on this
filesystem
|
SeekableByteChannel |
newByteChannel(Path path,
Set<? extends OpenOption> options,
FileAttribute<?>... attrs)
Obtain a new
SeekableByteChannel from a path for this filesystem |
WatchService |
newWatchService()
Get a file watch service for this filesystem
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckAccess, copy, createDirectory, delete, getFileAttributeView, isHidden, move, newDirectoryStream, newInputStream, newOutputStream, readAttributes, readAttributes, setAttributeprotected final PathElementsFactory pathElementsFactory
protected FileSystemDriverBase(URI uri, PathElementsFactory pathElementsFactory, FileStore fileStore, PathMatcherProvider pathMatcherProvider)
@Nonnull public final URI getUri()
FileSystemDrivergetUri in interface FileSystemDriver@Nonnull public final PathElementsFactory getPathElementsFactory()
FileSystemDriverPathElementsFactory associated with this filesystemgetPathElementsFactory in interface FileSystemDriver@Nonnull public final PathElements getRoot()
FileSystemDriverTypically, for Unix-like systems, this will be /.
getRoot in interface FileSystemDriverPathElements representing the root of the hierarchyFileSystem.getRootDirectories()@Nonnull public final FileStore getFileStore()
FileSystemDriverFileStore associated with this filesystemgetFileStore in interface FileSystemDriverFileStoreFileStoreBase@Nonnull public Set<String> getSupportedFileAttributeViews()
FileSystemDriverThis set (and therefore all implemented filesystems) must at least
contain "basic".
getSupportedFileAttributeViews in interface FileSystemDriverFileSystem.supportedFileAttributeViews()@Nonnull public final PathMatcherProvider getPathMatcherProvider()
FileSystemDriverPathMatcher provider for this filesystemgetPathMatcherProvider in interface FileSystemDriverFileSystem.getPathMatcher(String),
com.github.fge.filesystem.path.matchers@Nonnull public UserPrincipalLookupService getUserPrincipalLookupService()
FileSystemDrivergetUserPrincipalLookupService in interface FileSystemDriverFileSystem.getUserPrincipalLookupService()@Nonnull public WatchService newWatchService()
FileSystemDrivernewWatchService in interface FileSystemDriverFileSystem.newWatchService()@Nonnull public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException
FileSystemDriverSeekableByteChannel from a path for this filesystem
Note that a SeekableByteChannel supports both reads and
writes.
newByteChannel in interface FileSystemDriverpath - the pathoptions - the set of open optionsattrs - the attributes to create the file with (if it does not
exist)IOException - filesystem level error, or a plain I/O errorFileSystemProvider.newByteChannel(Path, Set, FileAttribute[])public boolean isSameFile(Path path, Path path2) throws IOException
FileSystemDriverNote that this DOES NOT apply to symbolic links, if the filesystem
supports them; that is, if path is a symlink to path2,
they are not the same file. Also, in spite of the method name,
this method can be called on paths which are not regular files but
directories, symlinks or others.
Two paths which are equal are always the
same.
isSameFile in interface FileSystemDriverpath - the first pathpath2 - the second pathIOException - filesystem level error, or a plain I/O errorFileSystemProvider.isSameFile(Path, Path)