@ThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class TFileSystemProvider extends java.nio.file.spi.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 |
|---|---|
|
TFileSystemProvider()
Deprecated.
Do NOT call this constructor directly!
|
private |
TFileSystemProvider(String scheme,
URI root) |
| Modifier and Type | Method and Description |
|---|---|
void |
checkAccess(java.nio.file.Path path,
java.nio.file.AccessMode... modes) |
void |
copy(java.nio.file.Path source,
java.nio.file.Path target,
java.nio.file.CopyOption... options) |
private static void |
copy(TPath src,
TPath dst,
java.nio.file.CopyOption... options) |
void |
createDirectory(java.nio.file.Path dir,
java.nio.file.attribute.FileAttribute<?>... attrs) |
void |
delete(java.nio.file.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 java.nio.file.attribute.FileAttributeView> |
getFileAttributeView(java.nio.file.Path path,
Class<V> type,
java.nio.file.LinkOption... options) |
java.nio.file.FileStore |
getFileStore(java.nio.file.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(java.nio.file.Path path) |
boolean |
isSameFile(java.nio.file.Path a,
java.nio.file.Path b) |
private static boolean |
isSameFile0(java.nio.file.Path a,
java.nio.file.Path b) |
void |
move(java.nio.file.Path source,
java.nio.file.Path target,
java.nio.file.CopyOption... options) |
private static void |
move(TPath source,
TPath target,
java.nio.file.CopyOption... options) |
SeekableByteChannel |
newByteChannel(java.nio.file.Path path,
Set<? extends java.nio.file.OpenOption> options,
java.nio.file.attribute.FileAttribute<?>... attrs) |
java.nio.file.DirectoryStream<java.nio.file.Path> |
newDirectoryStream(java.nio.file.Path dir,
java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter) |
TFileSystem |
newFileSystem(java.nio.file.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(java.nio.file.Path path,
java.nio.file.OpenOption... options) |
OutputStream |
newOutputStream(java.nio.file.Path path,
java.nio.file.OpenOption... options) |
private static TPath |
promote(java.nio.file.Path path) |
private static TConfig |
push(Map<String,?> env) |
<A extends java.nio.file.attribute.BasicFileAttributes> |
readAttributes(java.nio.file.Path path,
Class<A> type,
java.nio.file.LinkOption... options) |
Map<String,Object> |
readAttributes(java.nio.file.Path path,
String attributes,
java.nio.file.LinkOption... options) |
void |
setAttribute(java.nio.file.Path path,
String attribute,
Object value,
java.nio.file.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_SCHEME
public static final String DEFAULT_ROOT_MOUNT_POINT
private static final URI DEFAULT_ROOT_MOUNT_POINT_URI
private static final FsManager manager
private static final Map<String,TFileSystemProvider> providers
private final String scheme
private final FsPath root
private Map<FsMountPoint,TFileSystem> fileSystems
@Deprecated public TFileSystemProvider()
scheme "tpath" for accessing
any path within the root mount point URI
"file:/".
Do NOT call this constructor directly - it's solely provided in order to use this file system provider class with the service location feature of the NIO.2 API!
static TFileSystemProvider get(URI name)
TPath URI.name - a TPath URI.public 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!public String getScheme()
getScheme in class java.nio.file.spi.FileSystemProviderpublic FsPath getRoot()
public TFileSystem newFileSystem(java.nio.file.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 java.nio.file.spi.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 java.nio.file.spi.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 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 java.nio.file.spi.FileSystemProvideruri - the TPath uri to return a file system for.IllegalArgumentException - if the given uri is opaque.TFileSystem getFileSystem(TPath path)
path - a path.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 java.nio.file.spi.FileSystemProvidername - the uri to return a TPath for.TPathIllegalArgumentException - if the given uri is opaque.public SeekableByteChannel newByteChannel(java.nio.file.Path path, Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs) throws IOException
newByteChannel in class java.nio.file.spi.FileSystemProviderIOExceptionpublic InputStream newInputStream(java.nio.file.Path path, java.nio.file.OpenOption... options) throws IOException
newInputStream in class java.nio.file.spi.FileSystemProviderIOExceptionpublic OutputStream newOutputStream(java.nio.file.Path path, java.nio.file.OpenOption... options) throws IOException
newOutputStream in class java.nio.file.spi.FileSystemProviderIOExceptionpublic java.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(java.nio.file.Path dir, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter) throws IOException
newDirectoryStream in class java.nio.file.spi.FileSystemProviderIOExceptionpublic void createDirectory(java.nio.file.Path dir, java.nio.file.attribute.FileAttribute<?>... attrs) throws IOException
createDirectory in class java.nio.file.spi.FileSystemProviderIOExceptionpublic void delete(java.nio.file.Path path) throws IOException
delete in class java.nio.file.spi.FileSystemProviderIOExceptionprivate static void delete(TPath path) throws IOException
IOExceptionpublic void copy(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options) throws IOException
copy in class java.nio.file.spi.FileSystemProviderIOExceptionprivate static void copy(TPath src, TPath dst, java.nio.file.CopyOption... options) throws IOException
IOExceptionpublic void move(java.nio.file.Path source, java.nio.file.Path target, java.nio.file.CopyOption... options) throws IOException
move in class java.nio.file.spi.FileSystemProviderIOExceptionprivate static void move(TPath source, TPath target, java.nio.file.CopyOption... options) throws IOException
IOExceptionpublic boolean isSameFile(java.nio.file.Path a, java.nio.file.Path b) throws IOException
isSameFile in class java.nio.file.spi.FileSystemProviderIOExceptionprivate static boolean isSameFile0(java.nio.file.Path a, java.nio.file.Path b) throws IOException
IOExceptionpublic boolean isHidden(java.nio.file.Path path) throws IOException
isHidden in class java.nio.file.spi.FileSystemProviderIOExceptionpublic java.nio.file.FileStore getFileStore(java.nio.file.Path path) throws IOException
getFileStore in class java.nio.file.spi.FileSystemProviderUnsupportedOperationException - alwaysIOExceptionpublic void checkAccess(java.nio.file.Path path, java.nio.file.AccessMode... modes) throws IOException
checkAccess in class java.nio.file.spi.FileSystemProviderIOException@Nullable public <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView(java.nio.file.Path path, Class<V> type, java.nio.file.LinkOption... options)
getFileAttributeView in class java.nio.file.spi.FileSystemProviderpublic <A extends java.nio.file.attribute.BasicFileAttributes> A readAttributes(java.nio.file.Path path, Class<A> type, java.nio.file.LinkOption... options) throws IOException
readAttributes in class java.nio.file.spi.FileSystemProviderIOExceptionpublic Map<String,Object> readAttributes(java.nio.file.Path path, String attributes, java.nio.file.LinkOption... options) throws IOException
readAttributes in class java.nio.file.spi.FileSystemProviderUnsupportedOperationException - alwaysIOExceptionpublic void setAttribute(java.nio.file.Path path, String attribute, Object value, java.nio.file.LinkOption... options) throws IOException
setAttribute in class java.nio.file.spi.FileSystemProviderUnsupportedOperationException - alwaysIOExceptionprivate static TPath promote(java.nio.file.Path path)
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.