E - the type of the archive entries.@NotThreadSafe final class FsTargetArchiveController<E extends FsArchiveEntry> extends FsFileSystemArchiveController<E>
| Modifier and Type | Class and Description |
|---|---|
private static class |
FsTargetArchiveController.DummyInputService<E extends Entry>
A dummy input archive to substitute for
null when copying. |
private static class |
FsTargetArchiveController.InputArchive<E extends FsArchiveEntry> |
private static class |
FsTargetArchiveController.OutputArchive<E extends FsArchiveEntry> |
private class |
FsTargetArchiveController.TouchListener
An archive file system listener which makes the output archive.
|
| Modifier and Type | Field and Description |
|---|---|
private FsArchiveDriver<E> |
driver |
private FsTargetArchiveController.InputArchive<E> |
inputArchive
An
FsTargetArchiveController.InputArchive 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 FsEntryName |
name
The entry name of the target archive file in the parent file system.
|
private FsTargetArchiveController.OutputArchive<E> |
outputArchive
The (possibly temporary)
FsTargetArchiveController.OutputArchive we are writing newly
created or modified entries to. |
private FsController<?> |
parent
The parent file system controller.
|
private FsArchiveFileSystemTouchListener<E> |
touchListener |
| Constructor and Description |
|---|
FsTargetArchiveController(FsLockModel model,
FsController<?> parent,
FsArchiveDriver<E> driver)
Constructs a new default archive file system controller.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
checkSync(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> |
close(ExceptionHandler<? super FsSyncException,X> handler)
Discards the file system, closes the input archive and finally the
output archive.
|
private <X extends IOException> |
copy(ExceptionHandler<? super FsSyncException,X> handler)
Synchronizes all entries in the (virtual) archive file system with the
(temporary) output archive file.
|
private static <E extends FsArchiveEntry,X extends IOException> |
copy(FsArchiveFileSystem<E> fs,
InputService<E> is,
OutputService<E> os,
ExceptionHandler<? super IOException,X> handler) |
(package private) FsTargetArchiveController.InputArchive<E> |
getCheckedInputArchive() |
(package private) FsTargetArchiveController.OutputArchive<E> |
getCheckedOutputArchive() |
Icon |
getClosedIcon()
Deprecated.
|
(package private) InputSocket<? extends E> |
getInputSocket(String name) |
Icon |
getOpenIcon()
Deprecated.
|
(package private) OutputSocket<? extends E> |
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() |
(package private) FsTargetArchiveController.OutputArchive<E> |
makeOutputArchive()
Ensures that
outputArchive does not return null. |
(package private) void |
mount(boolean autoCreate)
Mounts the (virtual) archive file system from the target file.
|
private void |
mount0(boolean autoCreate) |
private void |
setInputArchive(FsTargetArchiveController.InputArchive<E> ia) |
private void |
setOutputArchive(FsTargetArchiveController.OutputArchive<E> oa) |
<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.
|
private <X extends IOException> |
sync0(BitField<FsSyncOption> options,
ExceptionHandler<? super FsSyncException,X> handler) |
autoMount, getFileSystem, setFileSystemautoMount, getContext, getEntry, getInputSocket, getOutputSocket, isReadable, isReadOnly, isWritable, mknod, setContext, setReadOnly, setTime, setTime, unlinkcheckWriteLockedByCurrentThread, isWriteLockedByCurrentThread, readLock, writeLockgetModel, getMountPoint, isTouched, setTouchedequals, hashCode, isExecutable, sync, toStringprivate final FsArchiveDriver<E extends FsArchiveEntry> driver
@CheckForNull private FsTargetArchiveController.InputArchive<E extends FsArchiveEntry> inputArchive
FsTargetArchiveController.InputArchive 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
private final FsEntryName name
@CheckForNull private FsTargetArchiveController.OutputArchive<E extends FsArchiveEntry> outputArchive
FsTargetArchiveController.OutputArchive we are writing newly
created or modified entries to.private final FsController<?> parent
private final FsArchiveFileSystemTouchListener<E extends FsArchiveEntry> touchListener
FsTargetArchiveController(FsLockModel model, FsController<?> parent, FsArchiveDriver<E> driver)
model - the file system model.parent - the parent file systemdriver - the archive driver.void checkSync(FsEntryName name, @CheckForNull Entry.Access intention) throws FsNeedsSyncException
FsArchiveControllersync operation in
advance.checkSync 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.FsNeedsSyncException - If a sync operation is required before the
intended access could succeed.private <X extends IOException> void close(ExceptionHandler<? super FsSyncException,X> handler) throws FsControllerException, 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.FsControllerExceptionprivate <X extends IOException> void copy(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> fs, InputService<E> is, OutputService<E> os, ExceptionHandler<? super IOException,X> handler) throws X extends IOException
X extends IOException@Nullable FsTargetArchiveController.InputArchive<E> getCheckedInputArchive() throws FsNeedsSyncException
FsNeedsSyncException@Nullable FsTargetArchiveController.OutputArchive<E> getCheckedOutputArchive() throws FsNeedsSyncException
FsNeedsSyncException@Deprecated public Icon getClosedIcon() throws IOException
FsControllerJTree.getClosedIcon in class FsController<FsLockModel>IOException - on any I/O failure.InputSocket<? extends E> getInputSocket(String name)
getInputSocket in class FsArchiveController<E extends FsArchiveEntry>@Deprecated public Icon getOpenIcon() throws IOException
FsControllerJTree.getOpenIcon in class FsController<FsLockModel>IOException - on any I/O failure.OutputSocket<? extends E> 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<FsLockModel>private boolean invariants()
@CreatesObligation FsTargetArchiveController.OutputArchive<E> makeOutputArchive() throws IOException
outputArchive 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.IOExceptionvoid mount(boolean autoCreate)
throws IOException
FsFileSystemArchiveController
Upon normal termination, this method is expected to have called
FsFileSystemArchiveController.setFileSystem(de.schlichtherle.truezip.fs.archive.FsArchiveFileSystem<E>) 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 void mount0(boolean autoCreate)
throws IOException
IOExceptionprivate void setInputArchive(@CheckForNull FsTargetArchiveController.InputArchive<E> ia)
private void setOutputArchive(@CheckForNull FsTargetArchiveController.OutputArchive<E> oa)
public <X extends IOException> void sync(BitField<FsSyncOption> options, ExceptionHandler<? super FsSyncException,X> handler) throws FsControllerException, X extends IOException
FsControllersync in class FsController<FsLockModel>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 mapping them to output
IOExceptions.X - at the discretion of the exception handler
upon the occurence of any FsSyncException.FsControllerExceptionX extends IOExceptionprivate <X extends IOException> void sync0(BitField<FsSyncOption> options, ExceptionHandler<? super FsSyncException,X> handler) throws FsControllerException, X extends IOException
FsControllerExceptionX extends IOExceptionCopyright © 2005-2012 Schlichtherle IT Services. All Rights Reserved.