@ThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class TFileSystem extends 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,
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,
FileAttribute<?>... attrs) |
(package private) void |
delete(TPath path) |
private FsController<?> |
getController() |
(package private) FsEntry |
getEntry(TPath path) |
(package private) <V extends FileAttributeView> |
getFileAttributeView(TPath path,
Class<V> type,
LinkOption... options) |
Iterable<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.
|
PathMatcher |
getPathMatcher(String syntaxAndPattern) |
Iterable<Path> |
getRootDirectories() |
String |
getSeparator()
Returns
File.separator. |
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 OpenOption> options,
FileAttribute<?>... attrs) |
(package private) DirectoryStream<Path> |
newDirectoryStream(TPath path,
DirectoryStream.Filter<? super Path> filter) |
(package private) InputStream |
newInputStream(TPath path,
OpenOption... options) |
(package private) OutputStream |
newOutputStream(TPath path,
OpenOption... options) |
WatchService |
newWatchService() |
TFileSystemProvider |
provider() |
(package private) <A extends BasicFileAttributes> |
readAttributes(TPath path,
Class<A> type,
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 final FsController<?> controller
private static final FsManager manager
private final TFileSystemProvider provider
TFileSystem(TPath path)
void checkAccess(TPath path, AccessMode... modes) throws IOException
IOExceptionpublic 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 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)void createDirectory(TPath path, FileAttribute<?>... attrs) throws IOException
IOExceptionvoid delete(TPath path) throws IOException
IOExceptionprivate FsController<?> getController()
FsEntry getEntry(TPath path) throws IOException
IOException@Nullable <V extends FileAttributeView> V getFileAttributeView(TPath path, Class<V> type, LinkOption... options)
public Iterable<FileStore> getFileStores()
getFileStores in class FileSystemUnsupportedOperationException - alwaysInputSocket<?> getInputSocket(TPath path, BitField<FsInputOption> options)
FsMountPoint getMountPoint()
OutputSocket<?> getOutputSocket(TPath path, BitField<FsOutputOption> options, @CheckForNull Entry template)
public 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 FileSystemfirst - the first sub path string.more - optional sub path strings.public PathMatcher getPathMatcher(String syntaxAndPattern)
getPathMatcher in class FileSystemUnsupportedOperationException - alwayspublic Iterable<Path> getRootDirectories()
getRootDirectories in class FileSystempublic String getSeparator()
File.separator.getSeparator in class FileSystemFile.separator.public UserPrincipalLookupService getUserPrincipalLookupService()
getUserPrincipalLookupService in class FileSystemUnsupportedOperationException - alwaysprivate boolean invariants()
public static boolean isLenient()
TConfig.get().isLenient().public boolean isOpen()
true.isOpen in class FileSystemtrue.public boolean isReadOnly()
false.isReadOnly in class FileSystemfalse.SeekableByteChannel newByteChannel(TPath path, Set<? extends OpenOption> options, FileAttribute<?>... attrs) throws IOException
IOExceptionDirectoryStream<Path> newDirectoryStream(TPath path, DirectoryStream.Filter<? super Path> filter) throws IOException
IOExceptionInputStream newInputStream(TPath path, OpenOption... options) throws IOException
IOExceptionOutputStream newOutputStream(TPath path, OpenOption... options) throws IOException
IOExceptionpublic WatchService newWatchService() throws IOException
newWatchService in class FileSystemUnsupportedOperationException - alwaysIOExceptionpublic TFileSystemProvider provider()
provider in class FileSystem<A extends BasicFileAttributes> A readAttributes(TPath path, Class<A> type, LinkOption... options) throws IOException
IOExceptionpublic static void setLenient(boolean lenient)
TConfig.get().setLenient(lenient).public Set<String> supportedFileAttributeViews()
supportedFileAttributeViews in class 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)Copyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.