E - The type of the archive entries.@NotThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) final class FsDefaultArchiveController<E extends FsArchiveEntry> extends FsFileSystemArchiveController<E>
| Modifier and Type | Class and Description |
|---|---|
private static class |
FsDefaultArchiveController.DummyInputArchive<E extends Entry>
A dummy input archive to substitute for
null when copying. |
private static class |
FsDefaultArchiveController.InputArchive<E extends FsArchiveEntry> |
private static class |
FsDefaultArchiveController.OutputArchive<E extends FsArchiveEntry> |
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.InputArchive<E> |
inputArchive
An
FsDefaultArchiveController.DummyInputArchive object used to mount the (virtual) archive file system
and read the entries from the archive file. |
private static BitField<FsInputOption> |
MOUNT_INPUT_OPTIONS |
private FsDefaultArchiveController.OutputArchive<E> |
outputArchive
The (possibly temporary)
FsDefaultArchiveController.OutputArchive we are writing newly
created or modified entries to. |
private FsController<?> |
parent |
private FsEntryName |
target |
private FsArchiveFileSystemTouchListener<E> |
touchListener |
| Constructor and Description |
|---|
FsDefaultArchiveController(FsConcurrentModel model,
FsController<?> parent,
FsArchiveDriver<E> driver)
Constructs a new archive file system controller.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
checkAccess(FsEntryName name,
Entry.Access intention)
Checks if the intended access to the named archive entry in the virtual
file system is possible without performing a
sync operation in
advance. |
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<? super IOException,X> handler) |
Icon |
getClosedIcon() |
private FsDefaultArchiveController.InputArchive<E> |
getInputArchive() |
(package private) InputSocket<?> |
getInputSocket(String name) |
Icon |
getOpenIcon() |
private FsDefaultArchiveController.OutputArchive<E> |
getOutputArchive() |
(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 FsDefaultArchiveController.OutputArchive<E> |
makeOutput()
Ensures that
getOutputArchive() does not return null. |
(package private) void |
mount(boolean autoCreate)
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 |
setInputArchive(FsDefaultArchiveController.InputArchive<E> inputArchive) |
private void |
setOutputArchive(FsDefaultArchiveController.OutputArchive<E> outputArchive) |
<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.
|
autoMount, getFileSystem, setFileSystemautoMount, getContext, getEntry, getInputSocket, getOutputSocket, isReadable, isReadOnly, isWritable, mknod, setContext, setReadOnly, setTime, setTime, unlinkassertNotReadLockedByCurrentThread, assertWriteLockedByCurrentThread, isWriteLockedByCurrentThread, readLock, writeLockgetModel, getMountPoint, isTouched, setTouchedequals, hashCode, isExecutable, sync, toStringprivate final FsArchiveDriver<E extends FsArchiveEntry> driver
@CheckForNull private FsDefaultArchiveController.InputArchive<E extends FsArchiveEntry> inputArchive
FsDefaultArchiveController.DummyInputArchive object used to mount the (virtual) archive file system
and read the entries from the archive file.private static final BitField<FsInputOption> MOUNT_INPUT_OPTIONS
@CheckForNull private FsDefaultArchiveController.OutputArchive<E extends FsArchiveEntry> outputArchive
FsDefaultArchiveController.OutputArchive we are writing newly
created or modified entries to.private final FsController<?> parent
private final FsEntryName target
private final FsArchiveFileSystemTouchListener<E extends FsArchiveEntry> touchListener
FsDefaultArchiveController(FsConcurrentModel model, FsController<?> parent, FsArchiveDriver<E> driver)
model - the concurrent file system model.parent - the parent file systemdriver - the archive driver.void checkAccess(FsEntryName name, @CheckForNull Entry.Access intention) throws FsNotSyncedException
FsArchiveControllersync operation in
advance.checkAccess in class FsArchiveController<E extends FsArchiveEntry>name - the file system entry name.intention - the intended I/O operation on the archive entry.
If null, then only an update to the archive entry meta
data (i.e. a pure virtual file system operation with no I/O)
is intended.FsNotSyncedException - If a sync operation is required.private <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 static <E extends FsArchiveEntry,X extends IOException> void copy(FsArchiveFileSystem<E> fileSystem, InputService<E> input, OutputService<E> output, ExceptionHandler<? super IOException,X> handler) throws X extends IOException
X extends IOExceptionpublic Icon getClosedIcon() throws IOException
getClosedIcon in class FsController<FsConcurrentModel>IOException@Nullable private FsDefaultArchiveController.InputArchive<E> getInputArchive()
InputSocket<?> getInputSocket(String name)
getInputSocket in class FsArchiveController<E extends FsArchiveEntry>public Icon getOpenIcon() throws IOException
getOpenIcon in class FsController<FsConcurrentModel>IOException@Nullable private FsDefaultArchiveController.OutputArchive<E> getOutputArchive()
OutputSocket<?> getOutputSocket(E entry)
getOutputSocket in class FsArchiveController<E extends FsArchiveEntry>public FsController<?> getParent()
FsControllernull if
and only if this file system is not federated, i.e. not a member of
another file system.
Multiple invocations must return the same object.getParent in class FsController<FsConcurrentModel>private boolean invariants()
private FsDefaultArchiveController.OutputArchive<E> makeOutput() throws IOException
getOutputArchive() does not return null.
This method will use
FsArchiveController.getContext().FsOperationContext.getOutputOptions()
to obtain the output options to use for writing the entry in the parent
file system.IOException - on any I/O error.void mount(boolean autoCreate)
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.IOExceptionprivate <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 void setInputArchive(@CheckForNull FsDefaultArchiveController.InputArchive<E> inputArchive)
private void setOutputArchive(@CheckForNull FsDefaultArchiveController.OutputArchive<E> outputArchive)
public <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 IOExceptionCopyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.