@ThreadSafe @ServiceImplementation(value=java.nio.file.spi.FileSystemProvider.class) public final class TFileSystemProvider extends FileSystemProvider
FileSystemProvider
implementation for use with NIO.2.Modifier and Type | Class and Description |
---|---|
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.
|
static String |
DEFAULT_SCHEME
The scheme of the provider for the public no-arg constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
checkAccess(Path path,
AccessMode... modes) |
void |
copy(Path source,
Path target,
CopyOption... options) |
void |
createDirectory(Path dir,
FileAttribute<?>... attrs) |
void |
delete(Path path) |
<V extends FileAttributeView> |
getFileAttributeView(Path path,
Class<V> type,
LinkOption... options) |
FileStore |
getFileStore(Path 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 . |
String |
getScheme()
Returns the default scheme of this provider.
|
boolean |
isHidden(Path path) |
boolean |
isSameFile(Path a,
Path b) |
void |
move(Path source,
Path 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) |
<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) |
createLink, createSymbolicLink, deleteIfExists, installedProviders, newAsynchronousFileChannel, newFileChannel, readSymbolicLink
public static final String DEFAULT_ROOT_MOUNT_POINT
public static final String DEFAULT_SCHEME
public void checkAccess(Path path, AccessMode... modes) throws IOException
checkAccess
in class FileSystemProvider
IOException
public void copy(Path source, Path target, CopyOption... options) throws IOException
copy
in class FileSystemProvider
IOException
public void createDirectory(Path dir, FileAttribute<?>... attrs) throws IOException
createDirectory
in class FileSystemProvider
IOException
public void delete(Path path) throws IOException
delete
in class FileSystemProvider
IOException
@Nullable public <V extends FileAttributeView> V getFileAttributeView(Path path, Class<V> type, LinkOption... options)
getFileAttributeView
in class FileSystemProvider
public FileStore getFileStore(Path path) throws IOException
getFileStore
in class FileSystemProvider
IOException
public TFileSystem getFileSystem(URI uri)
TPath
uri
.
The uri
is scanned for prospective archive files using the
current configuration
.
Any trailing separators in uri
current 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 FileSystemProvider
uri
- 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
current discarded.
getPath
in class FileSystemProvider
name
- the uri to return a TPath
for.TPath
IllegalArgumentException
- if the given uri
is opaque.public String getScheme()
getScheme
in class FileSystemProvider
public boolean isHidden(Path path) throws IOException
isHidden
in class FileSystemProvider
IOException
public boolean isSameFile(Path a, Path b) throws IOException
isSameFile
in class FileSystemProvider
IOException
public void move(Path source, Path target, CopyOption... options) throws IOException
move
in class FileSystemProvider
IOException
public SeekableByteChannel newByteChannel(Path path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException
newByteChannel
in class FileSystemProvider
IOException
public DirectoryStream<Path> newDirectoryStream(Path dir, DirectoryStream.Filter<? super Path> filter) throws IOException
newDirectoryStream
in class FileSystemProvider
IOException
public 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.Parameter
s current 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 FileSystemProvider
path
- 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.Parameter
s current 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
current 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 FileSystemProvider
uri
- 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 FileSystemProvider
IOException
public OutputStream newOutputStream(Path path, OpenOption... options) throws IOException
newOutputStream
in class FileSystemProvider
IOException
public <A extends BasicFileAttributes> A readAttributes(Path path, Class<A> type, LinkOption... options) throws IOException
readAttributes
in class FileSystemProvider
IOException
public Map<String,Object> readAttributes(Path path, String attributes, LinkOption... options) throws IOException
readAttributes
in class FileSystemProvider
IOException
public void setAttribute(Path path, String attribute, Object value, LinkOption... options) throws IOException
setAttribute
in class FileSystemProvider
IOException
Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.