@ThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class TFileSystemProvider extends FileSystemProvider
FileSystemProvider implementation
based on the TrueZIP Kernel module.| Modifier and Type | Class and Description |
|---|---|
private static class |
TFileSystemProvider.Holder |
static interface |
TFileSystemProvider.Parameter
Keys for environment maps.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_ROOT_MOUNT_POINT
The root mount point of the provider for the public no-arg constructor.
|
private static URI |
DEFAULT_ROOT_MOUNT_POINT_URI |
static String |
DEFAULT_SCHEME
The scheme of the provider for the public no-arg constructor.
|
private Map<FsMountPoint,TFileSystem> |
fileSystems |
private static FsManager |
manager |
private static Map<String,TFileSystemProvider> |
providers |
private FsPath |
root |
private String |
scheme |
| Modifier | Constructor and Description |
|---|---|
private |
TFileSystemProvider(String scheme,
URI root) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkAccess(Path path,
AccessMode... modes) |
void |
copy(Path source,
Path target,
CopyOption... options) |
private static void |
copy(TPath src,
TPath dst,
CopyOption... options) |
void |
createDirectory(Path dir,
FileAttribute<?>... attrs) |
void |
delete(Path path) |
private static void |
delete(TPath path) |
(package private) static TFileSystemProvider |
get(URI name)
Obtains a file system provider for the given
TPath URI. |
<V extends FileAttributeView> |
getFileAttributeView(Path path,
Class<V> type,
LinkOption... options) |
FileStore |
getFileStore(Path path) |
(package private) TFileSystem |
getFileSystem(TPath path)
Obtains a file system for the given path.
|
TFileSystem |
getFileSystem(URI uri)
Returns a file system for the given hierarchical
TPath
uri. |
TPath |
getPath(URI name)
Returns a
TPath for the given hierarchical name. |
FsPath |
getRoot()
Returns the root mount point of this provider.
|
String |
getScheme()
Returns the default scheme of this provider.
|
boolean |
isHidden(Path path) |
boolean |
isSameFile(Path a,
Path b) |
private static boolean |
isSameFile0(Path a,
Path b) |
void |
move(Path source,
Path target,
CopyOption... options) |
private static void |
move(TPath source,
TPath target,
CopyOption... options) |
SeekableByteChannel |
newByteChannel(Path path,
Set<? extends OpenOption> options,
FileAttribute<?>... attrs) |
DirectoryStream<Path> |
newDirectoryStream(Path dir,
DirectoryStream.Filter<? super Path> filter) |
TFileSystem |
newFileSystem(Path path,
Map<String,?> configuration)
Scans the given
path for prospective archive files using the
given configuration and returns the file system for the
innermost prospective archive file or throws an
UnsupportedOperationException if no prospective archive file is
detected. |
TFileSystem |
newFileSystem(URI uri,
Map<String,?> configuration)
Returns a file system for the given hierarchical
TPath
uri. |
InputStream |
newInputStream(Path path,
OpenOption... options) |
OutputStream |
newOutputStream(Path path,
OpenOption... options) |
private static TPath |
promote(Path path) |
private static TConfig |
push(Map<String,?> env) |
<A extends BasicFileAttributes> |
readAttributes(Path path,
Class<A> type,
LinkOption... options) |
Map<String,Object> |
readAttributes(Path path,
String attributes,
LinkOption... options) |
void |
setAttribute(Path path,
String attribute,
Object value,
LinkOption... options) |
static void |
umount()
Commits all unsynchronized changes to the contents of all federated file
systems (i.e. prospective archive files) to their respective parent file
system, releases the associated resources (i.e. target archive files)
for access by third parties (e.g. other processes), cleans up any
temporary allocated resources (e.g. temporary files) and purges any
cached data.
|
createLink, createSymbolicLink, deleteIfExists, installedProviders, newAsynchronousFileChannel, newFileChannel, readSymbolicLinkpublic static final String DEFAULT_ROOT_MOUNT_POINT
private static final URI DEFAULT_ROOT_MOUNT_POINT_URI
public static final String DEFAULT_SCHEME
private Map<FsMountPoint,TFileSystem> fileSystems
private static final FsManager manager
private static final Map<String,TFileSystemProvider> providers
private final FsPath root
private final String scheme
public void checkAccess(Path path, AccessMode... modes) throws IOException
checkAccess in class FileSystemProviderIOExceptionpublic void copy(Path source, Path target, CopyOption... options) throws IOException
copy in class FileSystemProviderIOExceptionprivate static void copy(TPath src, TPath dst, CopyOption... options) throws IOException
IOExceptionpublic void createDirectory(Path dir, FileAttribute<?>... attrs) throws IOException
createDirectory in class FileSystemProviderIOExceptionpublic void delete(Path path) throws IOException
delete in class FileSystemProviderIOExceptionprivate static void delete(TPath path) throws IOException
IOExceptionstatic TFileSystemProvider get(URI name)
TPath URI.name - a TPath URI.@Nullable public <V extends FileAttributeView> V getFileAttributeView(Path path, Class<V> type, LinkOption... options)
getFileAttributeView in class FileSystemProviderpublic FileStore getFileStore(Path path) throws IOException
getFileStore in class FileSystemProviderUnsupportedOperationException - alwaysIOExceptionTFileSystem getFileSystem(TPath path)
path - a path.public TFileSystem getFileSystem(URI uri)
TPath
uri.
The uri is scanned for prospective archive files using the
current configuration.
Any trailing separators in uri get discarded.
If one or more prospective archive files are found, the file system for
the innermost prospective archive file is returned.
Otherwise, the file system for the innermost directory is returned.
getFileSystem in class FileSystemProvideruri - the TPath uri to return a file system for.IllegalArgumentException - if the given uri is opaque.public TPath getPath(URI name)
TPath for the given hierarchical name.
The URI path component is scanned for prospective archive files using
the current configuration.
Any trailing separators in name get discarded.
getPath in class FileSystemProvidername - the uri to return a TPath for.TPathIllegalArgumentException - if the given uri is opaque.public FsPath getRoot()
public String getScheme()
getScheme in class FileSystemProviderpublic boolean isHidden(Path path) throws IOException
isHidden in class FileSystemProviderIOExceptionpublic boolean isSameFile(Path a, Path b) throws IOException
isSameFile in class FileSystemProviderIOExceptionprivate static boolean isSameFile0(Path a, Path b) throws IOException
IOExceptionpublic void move(Path source, Path target, CopyOption... options) throws IOException
move in class FileSystemProviderIOExceptionprivate static void move(TPath source, TPath target, CopyOption... options) throws IOException
IOExceptionpublic SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException
newByteChannel in class FileSystemProviderIOExceptionpublic DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) throws IOException
newDirectoryStream in class FileSystemProviderIOExceptionpublic TFileSystem newFileSystem(Path path, Map<String,?> configuration)
path for prospective archive files using the
given configuration and returns the file system for the
innermost prospective archive file or throws an
UnsupportedOperationException if no prospective archive file is
detected.
First, the configuration TFileSystemProvider.Parameters get enumerated.
If no value is set for a parameter key, the respective value of the
current configuration gets used.
Next, the path is scanned for prospective archive files using
the configuration resulting from the first step.
If one or more prospective archive files are found, the file system for
the innermost prospective archive file is returned.
Otherwise, an UnsupportedOperationException is thrown.
newFileSystem in class FileSystemProviderpath - the path to scan for prospective archive files.configuration - may contain a TArchiveDetector for the key
TFileSystemProvider.Parameter.ARCHIVE_DETECTOR.UnsupportedOperationException - if no prospective archive file has
been detected according to the configuration resulting from
merging the given configuration with the
current configuration.public TFileSystem newFileSystem(URI uri, Map<String,?> configuration)
TPath
uri.
First, the configuration TFileSystemProvider.Parameters get enumerated.
If no value is set for a parameter key, the respective value of the
current configuration gets used.
Next, the uri is scanned for prospective archive files using
the configuration resulting from the first step.
Any trailing separators in uri get discarded.
If one or more prospective archive files are found, the file system for
the innermost prospective archive file is returned.
Otherwise, the file system for the innermost directory is returned.
newFileSystem in class FileSystemProvideruri - the TPath uri to return a file system for.configuration - may contain a TArchiveDetector for the key
TFileSystemProvider.Parameter.ARCHIVE_DETECTOR.IllegalArgumentException - if the given uri is opaque.public InputStream newInputStream(Path path, OpenOption... options) throws IOException
newInputStream in class FileSystemProviderIOExceptionpublic OutputStream newOutputStream(Path path, OpenOption... options) throws IOException
newOutputStream in class FileSystemProviderIOExceptionpublic <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type, LinkOption... options) throws IOException
readAttributes in class FileSystemProviderIOExceptionpublic Map<String,Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException
readAttributes in class FileSystemProviderUnsupportedOperationException - alwaysIOExceptionpublic void setAttribute(Path path, String attribute, Object value, LinkOption... options) throws IOException
setAttribute in class FileSystemProviderUnsupportedOperationException - alwaysIOExceptionpublic static void umount()
throws FsSyncException
FsSyncWarningException - if only warning conditions
occur.
This implies that the respective parent file system has been
updated with constraints, such as a failure to set the last
modification time of the entry for the federated file system
(i.e. archive file) in its parent file system.FsSyncException - if any error conditions occur.
This implies loss of data!Copyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.