E - The type of the archive entries.@NotThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class FsDefaultArchiveController<E extends FsArchiveEntry> extends FsFileSystemArchiveController<E>
| Modifier and Type | Class and Description |
|---|---|
private static class |
FsDefaultArchiveController.DummyInputService<E extends Entry>
A dummy input service to substitute for
null. |
private class |
FsDefaultArchiveController.Input
This member class makes this archive controller instance strongly
reachable from any created input stream.
|
private class |
FsDefaultArchiveController.Output
This member class makes this archive controller instance strongly
reachable from any created output stream.
|
private class |
FsDefaultArchiveController.TouchListener
An archive file system listener which makes the output before it
touches the file system model.
|
| Modifier and Type | Field and Description |
|---|---|
private FsArchiveDriver<E> |
driver |
private FsDefaultArchiveController.Input |
input
An
FsDefaultArchiveController.Input object used to mount the (virtual) archive file system
and read the entries from the archive file. |
private static BitField<FsOutputOption> |
MAKE_OUTPUT_OPTIONS |
private static BitField<FsInputOption> |
MOUNT_INPUT_OPTIONS |
private static BitField<FsOutputOption> |
MOUNT_MASK |
private FsDefaultArchiveController.Output |
output
The (possibly temporary)
FsDefaultArchiveController.Output we are writing newly
created or modified entries to. |
private FsController<?> |
parent |
private FsEntryName |
parentName |
private static BitField<FsSyncOption> |
SYNC_OPTIONS |
private FsArchiveFileSystemTouchListener<E> |
touchListener |
| Constructor and Description |
|---|
FsDefaultArchiveController(FsConcurrentModel model,
FsArchiveDriver<E> driver,
FsController<?> parent) |
| Modifier and Type | Method and Description |
|---|---|
(package private) boolean |
autoSync(FsEntryName name,
Entry.Access intention)
Synchronizes the archive file only if the archive file has new data for
the file system entry with the given path path.
|
private <X extends IOException> |
awaitSync(BitField<FsSyncOption> options,
ExceptionHandler<? super FsSyncException,X> handler)
Waits for all entry input and entry output streams to close or forces
them to close, dependending on the
options. |
private <X extends IOException> |
commenceSync(ExceptionHandler<? super FsSyncException,X> handler)
Closes and disconnects all entry streams of the output and input
archive.
|
private <X extends IOException> |
commitSync(ExceptionHandler<? super FsSyncException,X> handler)
Discards the file system and closes the output and input archive.
|
private static <E extends FsArchiveEntry,X extends IOException> |
copy(FsArchiveFileSystem<E> fileSystem,
InputService<E> input,
OutputService<E> output,
ExceptionHandler<IOException,X> handler) |
Icon |
getClosedIcon() |
private FsDefaultArchiveController.Input |
getInput() |
(package private) InputSocket<?> |
getInputSocket(String name) |
Icon |
getOpenIcon() |
private FsDefaultArchiveController.Output |
getOutput() |
(package private) OutputSocket<?> |
getOutputSocket(E entry) |
FsController<?> |
getParent()
Returns the controller for the parent file system or
null if
and only if this file system is not federated, i.e. not a member of
another file system. |
private boolean |
invariants() |
private boolean |
isTouched() |
(package private) FsDefaultArchiveController.Output |
makeOutput(BitField<FsOutputOption> options)
Ensures that
output is not null. |
(package private) void |
mount(boolean autoCreate,
BitField<FsOutputOption> options)
Mounts the (virtual) archive file system from the target file.
|
private <X extends IOException> |
performSync(ExceptionHandler<? super FsSyncException,X> handler)
Synchronizes all entries in the (virtual) archive file system with the
(temporary) output archive file.
|
private void |
setInput(FsDefaultArchiveController.Input input) |
private void |
setOutput(FsDefaultArchiveController.Output output) |
private boolean |
sync() |
<X extends IOException> |
sync(BitField<FsSyncOption> options,
ExceptionHandler<? super FsSyncException,X> handler)
Commits all unsynchronized changes to the contents of this file system
to its parent file system,
releases the associated resources (e.g. 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.
|
void |
unlink(FsEntryName name) |
autoMount, getFileSystem, setFileSystemautoMount, getEntry, getInputSocket, getModel, getOutputSocket, isReadable, isReadOnly, isWritable, mknod, setReadOnly, setTimeequals, hashCode, sync, toStringprivate static final BitField<FsOutputOption> MOUNT_MASK
private static final BitField<FsInputOption> MOUNT_INPUT_OPTIONS
private static final BitField<FsOutputOption> MAKE_OUTPUT_OPTIONS
private static final BitField<FsSyncOption> SYNC_OPTIONS
private final FsArchiveDriver<E extends FsArchiveEntry> driver
private final FsController<?> parent
private final FsEntryName parentName
@Nullable private FsDefaultArchiveController.Input input
FsDefaultArchiveController.Input object used to mount the (virtual) archive file system
and read the entries from the archive file.@Nullable private FsDefaultArchiveController.Output output
FsDefaultArchiveController.Output we are writing newly
created or modified entries to.private final FsArchiveFileSystemTouchListener<E extends FsArchiveEntry> touchListener
public FsDefaultArchiveController(FsConcurrentModel model, FsArchiveDriver<E> driver, FsController<?> parent)
private boolean invariants()
private FsDefaultArchiveController.Input getInput()
private void setInput(@CheckForNull
FsDefaultArchiveController.Input input)
private FsDefaultArchiveController.Output getOutput()
private void setOutput(@CheckForNull
FsDefaultArchiveController.Output output)
public FsController<?> getParent()
FsControllernull if
and only if this file system is not federated, i.e. not a member of
another file system.getParent in class FsController<FsConcurrentModel>public Icon getOpenIcon() throws IOException
getOpenIcon in class FsController<FsConcurrentModel>IOExceptionpublic Icon getClosedIcon() throws IOException
getClosedIcon in class FsController<FsConcurrentModel>IOExceptionvoid mount(boolean autoCreate,
BitField<FsOutputOption> options)
throws IOException
FsFileSystemArchiveController
Upon normal termination, this method is expected to have called
FsFileSystemArchiveController.ResetFileSystem to assign the fully initialized file system
to this controller.
Other than this, the method must not have any side effects on the
state of this class or its super class.
It may, however, have side effects on the state of the sub class.
mount in class FsFileSystemArchiveController<E extends FsArchiveEntry>autoCreate - If the archive file does not exist and this is
true, a new file system with only a (virtual) root
directory is created with its last modification time set to the
system's current time.IOExceptionFsDefaultArchiveController.Output makeOutput(BitField<FsOutputOption> options) throws IOException
output is not null.options - a bit field of output options.IOException - on any I/O error.InputSocket<?> getInputSocket(String name) throws IOException
getInputSocket in class FsArchiveController<E extends FsArchiveEntry>IOExceptionOutputSocket<?> getOutputSocket(E entry) throws IOException
getOutputSocket in class FsArchiveController<E extends FsArchiveEntry>IOExceptionpublic void unlink(FsEntryName name) throws IOException
unlink in class FsArchiveController<E extends FsArchiveEntry>IOExceptionboolean autoSync(FsEntryName name, @CheckForNull Entry.Access intention) throws FsSyncException, FsException
FsArchiveControllerWarning: As a side effect, all data structures may get reset (filesystem, entries, streams, etc.)! This method may require synchronization on the write lock!
autoSync in class FsArchiveController<E extends FsArchiveEntry>name - the non-null entry name.intention - the intended operation on the entry. If null,
a pure file system operation with no I/O is intended.FsSyncExceptionFsExceptionFsController.sync(de.schlichtherle.truezip.util.BitField<de.schlichtherle.truezip.fs.FsSyncOption>)private boolean sync()
throws FsSyncException,
FsException
FsSyncExceptionFsExceptionpublic <X extends IOException> void sync(BitField<FsSyncOption> options, ExceptionHandler<? super FsSyncException,X> handler) throws X extends IOException
FsControllersync in class FsController<FsConcurrentModel>X - The type of the IOException to throw at the
discretion of the exception handler.options - a bit field of synchronization options.handler - the exception handling strategy for consuming input
FsSyncExceptions and/or assembling output
IOExceptions.X extends IOExceptionprivate <X extends IOException> void awaitSync(BitField<FsSyncOption> options, ExceptionHandler<? super FsSyncException,X> handler) throws X extends IOException
options.X - The type of the IOException to throw at the
discretion of the exception handler.options - a bit field of synchronization options.handler - the exception handling strategy for consuming input
FsSyncExceptions and/or assembling output
IOExceptions.IOException - at the discretion of the exception handler
upon the occurence of an FsSyncException.private <X extends IOException> void commenceSync(ExceptionHandler<? super FsSyncException,X> handler) throws X extends IOException
X - The type of the IOException to throw at the
discretion of the exception handler.handler - the exception handling strategy for consuming input
FsSyncExceptions and/or assembling output
IOExceptions.IOException - at the discretion of the exception handler
upon the occurence of an FsSyncException.private <X extends IOException> void performSync(ExceptionHandler<? super FsSyncException,X> handler) throws X extends IOException
X - The type of the IOException to throw at the
discretion of the exception handler.handler - the exception handling strategy for consuming input
FsSyncExceptions and/or assembling output
IOExceptions.IOException - at the discretion of the exception handler
upon the occurence of an FsSyncException.private static <E extends FsArchiveEntry,X extends IOException> void copy(FsArchiveFileSystem<E> fileSystem, InputService<E> input, OutputService<E> output, ExceptionHandler<IOException,X> handler) throws X extends IOException
X extends IOExceptionprivate <X extends IOException> void commitSync(ExceptionHandler<? super FsSyncException,X> handler) throws X extends IOException
X - The type of the IOException to throw at the
discretion of the exception handler.handler - the exception handling strategy for consuming input
FsSyncExceptions and/or assembling output
IOExceptions.IOException - at the discretion of the exception handler
upon the occurence of an FsSyncException.private boolean isTouched()
Copyright © 2005-2011 Schlichtherle IT Services. All Rights Reserved.