@ThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class TFileSystem extends java.nio.file.FileSystem
FileSystem implementation based on the TrueZIP Kernel module.| Modifier and Type | Class and Description |
|---|---|
private class |
TFileSystem.FsEntryAttributes |
private class |
TFileSystem.FsEntryAttributeView |
| Modifier and Type | Field and Description |
|---|---|
private FsController<?> |
controller |
private static FsManager |
manager |
private TFileSystemProvider |
provider |
| Constructor and Description |
|---|
TFileSystem(TPath path) |
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
checkAccess(TPath path,
java.nio.file.AccessMode... modes) |
void |
close()
Commits all unsynchronized changes to the contents of this federated
file system (i.e. prospective archive files)
and all its member federated file systems to their respective parent
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.
|
(package private) void |
createDirectory(TPath path,
java.nio.file.attribute.FileAttribute<?>... attrs) |
(package private) void |
delete(TPath path) |
private FsController<?> |
getController() |
(package private) FsEntry |
getEntry(TPath path) |
(package private) <V extends java.nio.file.attribute.FileAttributeView> |
getFileAttributeView(TPath path,
Class<V> type,
java.nio.file.LinkOption... options) |
Iterable<java.nio.file.FileStore> |
getFileStores() |
(package private) InputSocket<?> |
getInputSocket(TPath path,
BitField<FsInputOption> options) |
(package private) FsMountPoint |
getMountPoint() |
(package private) OutputSocket<?> |
getOutputSocket(TPath path,
BitField<FsOutputOption> options,
Entry template) |
TPath |
getPath(String first,
String... more)
Constructs a new path from the given sub path strings.
|
java.nio.file.PathMatcher |
getPathMatcher(String syntaxAndPattern) |
Iterable<java.nio.file.Path> |
getRootDirectories() |
String |
getSeparator()
Returns
File.separator. |
java.nio.file.attribute.UserPrincipalLookupService |
getUserPrincipalLookupService() |
private boolean |
invariants() |
static boolean |
isLenient()
Equivalent to
TConfig.get().isLenient(). |
boolean |
isOpen()
Returns
true. |
boolean |
isReadOnly()
Returns
false. |
(package private) SeekableByteChannel |
newByteChannel(TPath path,
Set<? extends java.nio.file.OpenOption> options,
java.nio.file.attribute.FileAttribute<?>... attrs) |
(package private) java.nio.file.DirectoryStream<java.nio.file.Path> |
newDirectoryStream(TPath path,
java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter) |
(package private) InputStream |
newInputStream(TPath path,
java.nio.file.OpenOption... options) |
(package private) OutputStream |
newOutputStream(TPath path,
java.nio.file.OpenOption... options) |
java.nio.file.WatchService |
newWatchService() |
TFileSystemProvider |
provider() |
(package private) <A extends java.nio.file.attribute.BasicFileAttributes> |
readAttributes(TPath path,
Class<A> type,
java.nio.file.LinkOption... options) |
static void |
setLenient(boolean lenient)
Equivalent to
TConfig.get().setLenient(lenient). |
Set<String> |
supportedFileAttributeViews() |
void |
sync(BitField<FsSyncOption> options)
Commits all unsynchronized changes to the contents of this federated
file system (i.e. prospective archive file)
and all its member federated file systems 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.
|
private static final FsManager manager
private final FsController<?> controller
private final TFileSystemProvider provider
TFileSystem(TPath path)
private boolean invariants()
public static boolean isLenient()
TConfig.get().isLenient().public static void setLenient(boolean lenient)
TConfig.get().setLenient(lenient).private FsController<?> getController()
FsMountPoint getMountPoint()
public TFileSystemProvider provider()
provider in class java.nio.file.FileSystempublic void sync(BitField<FsSyncOption> options) throws FsSyncException
If a client application needs to sync an individual archive file, the following idiom could be used:
if (file.isArchive() && file.getEnclArchive() == null) // filter top level federated file system
if (file.isDirectory()) // ignore false positives
TFile.sync(file); // sync federated file system and all its members
Again, this will also sync all federated file systems which are
located within the file system referred to by file.options - a bit field of synchronization options.IllegalArgumentException - if archive is not a top level
federated file system or the combination of synchronization
options is illegal, e.g. if
FsSyncOption.FORCE_CLOSE_INPUT is cleared and
FsSyncOption.FORCE_CLOSE_OUTPUT is set or if the
synchronization option FsSyncOption.ABORT_CHANGES is set.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!sync(BitField)public void close()
throws FsSyncException
This method is equivalent to calling
sync(FsSyncOptions.UMOUNT).
Note that the file system stays open (!) after this call and can get used subsequently.
close in interface Closeableclose in interface AutoCloseableclose in class java.nio.file.FileSystemFsSyncWarningException - 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. prospective archive file) in its parent file system.FsSyncException - if any error conditions occur.
This implies loss of data!sync(BitField)public boolean isOpen()
true.isOpen in class java.nio.file.FileSystemtrue.public boolean isReadOnly()
false.isReadOnly in class java.nio.file.FileSystemfalse.public String getSeparator()
File.separator.getSeparator in class java.nio.file.FileSystemFile.separator.public Iterable<java.nio.file.Path> getRootDirectories()
getRootDirectories in class java.nio.file.FileSystempublic Iterable<java.nio.file.FileStore> getFileStores()
getFileStores in class java.nio.file.FileSystemUnsupportedOperationException - alwayspublic Set<String> supportedFileAttributeViews()
supportedFileAttributeViews in class java.nio.file.FileSystempublic TPath getPath(String first, String... more)
This method scans the path name resulting
from the segment parameters to detect prospective archive files using
the default archive detector.
The supported path name separators are "File.separator" and
"/".
Any leading and trailing separators in the resulting path name get
discarded.
getPath in class java.nio.file.FileSystemfirst - the first sub path string.more - optional sub path strings.public java.nio.file.PathMatcher getPathMatcher(String syntaxAndPattern)
getPathMatcher in class java.nio.file.FileSystemUnsupportedOperationException - alwayspublic java.nio.file.attribute.UserPrincipalLookupService getUserPrincipalLookupService()
getUserPrincipalLookupService in class java.nio.file.FileSystemUnsupportedOperationException - alwayspublic java.nio.file.WatchService newWatchService() throws IOException
newWatchService in class java.nio.file.FileSystemUnsupportedOperationException - alwaysIOExceptionSeekableByteChannel newByteChannel(TPath path, Set<? extends java.nio.file.OpenOption> options, java.nio.file.attribute.FileAttribute<?>... attrs) throws IOException
IOExceptionInputStream newInputStream(TPath path, java.nio.file.OpenOption... options) throws IOException
IOExceptionOutputStream newOutputStream(TPath path, java.nio.file.OpenOption... options) throws IOException
IOExceptionjava.nio.file.DirectoryStream<java.nio.file.Path> newDirectoryStream(TPath path, java.nio.file.DirectoryStream.Filter<? super java.nio.file.Path> filter) throws IOException
IOExceptionvoid createDirectory(TPath path, java.nio.file.attribute.FileAttribute<?>... attrs) throws IOException
IOExceptionvoid delete(TPath path) throws IOException
IOExceptionFsEntry getEntry(TPath path) throws IOException
IOExceptionInputSocket<?> getInputSocket(TPath path, BitField<FsInputOption> options)
OutputSocket<?> getOutputSocket(TPath path, BitField<FsOutputOption> options, @CheckForNull Entry template)
void checkAccess(TPath path, java.nio.file.AccessMode... modes) throws IOException
IOException@Nullable <V extends java.nio.file.attribute.FileAttributeView> V getFileAttributeView(TPath path, Class<V> type, java.nio.file.LinkOption... options)
<A extends java.nio.file.attribute.BasicFileAttributes> A readAttributes(TPath path, Class<A> type, java.nio.file.LinkOption... options) throws IOException
IOExceptionCopyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.