|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.truezip.fs.FsController<FsConcurrentModel>
de.schlichtherle.truezip.fs.archive.FsArchiveController<E>
de.schlichtherle.truezip.fs.archive.FsFileSystemArchiveController<E>
de.schlichtherle.truezip.fs.archive.FsDefaultArchiveController<E>
E - The type of the archive entries.@NotThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public final class FsDefaultArchiveController<E extends FsArchiveEntry>
This archive controller implements the mounting/unmounting strategy for the container archive file.
| Nested Class Summary | |
|---|---|
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. |
| Field Summary | |
|---|---|
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
|
private boolean |
useRootTemplate
|
| Constructor Summary | |
|---|---|
FsDefaultArchiveController(FsConcurrentModel model,
FsArchiveDriver<E> driver,
FsController<?> parent,
boolean useRootTemplate)
|
|
| Method Summary | ||
|---|---|---|
(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
|
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
|
commenceSync(ExceptionHandler<? super FsSyncException,X> handler)
Closes and disconnects all entry streams of the output and input archive. |
|
private
|
commitSync(ExceptionHandler<? super FsSyncException,X> handler)
Discards the file system and closes the output and input archive. |
|
private static
|
copy(FsArchiveFileSystem<E> fileSystem,
InputService<E> input,
OutputService<E> output,
ExceptionHandler<IOException,X> handler)
|
|
Icon |
getClosedIcon()
|
|
(package private) InputSocket<?> |
getInputSocket(String name)
|
|
Icon |
getOpenIcon()
|
|
(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 |
isTouched()
|
|
(package private) void |
makeOutput(BitField<FsOutputOption> options,
Entry rootTemplate)
|
|
(package private) void |
mount(boolean autoCreate,
BitField<FsOutputOption> options)
Mounts the (virtual) archive file system from the target file. |
|
private
|
performSync(ExceptionHandler<? super FsSyncException,X> handler)
Synchronizes all entries in the (virtual) archive file system with the (temporary) output archive file. |
|
private boolean |
sync()
|
|
|
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. |
|
void |
unlink(FsEntryName name)
|
|
| Methods inherited from class de.schlichtherle.truezip.fs.archive.FsFileSystemArchiveController |
|---|
autoMount, getFileSystem, setFileSystem |
| Methods inherited from class de.schlichtherle.truezip.fs.archive.FsArchiveController |
|---|
autoMount, getEntry, getInputSocket, getModel, getOutputSocket, isReadable, isReadOnly, isWritable, mknod, setReadOnly, setTime |
| Methods inherited from class de.schlichtherle.truezip.fs.FsController |
|---|
equals, hashCode, sync, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private 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
private final boolean useRootTemplate
@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
| Constructor Detail |
|---|
public FsDefaultArchiveController(FsConcurrentModel model,
FsArchiveDriver<E> driver,
FsController<?> parent,
boolean useRootTemplate)
| Method Detail |
|---|
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>IOException
public Icon getClosedIcon()
throws IOException
getClosedIcon in class FsController<FsConcurrentModel>IOException
void 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.
IOException
void makeOutput(BitField<FsOutputOption> options,
Entry rootTemplate)
throws IOException
IOException
InputSocket<?> getInputSocket(String name)
throws IOException
getInputSocket in class FsArchiveController<E extends FsArchiveEntry>IOException
OutputSocket<?> getOutputSocket(E entry)
throws IOException
getOutputSocket in class FsArchiveController<E extends FsArchiveEntry>IOException
public void unlink(FsEntryName name)
throws IOException
unlink in class FsArchiveController<E extends FsArchiveEntry>IOException
boolean 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.
FsNotWriteLockedException
FsSyncException
FsExceptionFsController.sync(de.schlichtherle.truezip.util.BitField)
private boolean sync()
throws FsSyncException,
FsException
FsSyncException
FsException
public <X extends IOException> void sync(BitField<FsSyncOption> options,
ExceptionHandler<? super FsSyncException,X> handler)
throws X extends IOException
FsController
sync in class FsController<FsConcurrentModel>X - the type of the IOException to throw at the
discretion of the exception handler.options - the synchronization options.handler - the exception handling strategy for dealing with one or
more input FsSyncExceptions which may trigger an X.
X extends IOException
private <X extends IOException> void awaitSync(BitField<FsSyncOption> options,
ExceptionHandler<? super FsSyncException,X> handler)
throws X extends IOException
options.
options - the output options.handler - the exception handler.
FsSyncException - If any exceptional condition occurs
throughout the processing of the container archive file.
X extends IOException
private <X extends IOException> void commenceSync(ExceptionHandler<? super FsSyncException,X> handler)
throws X extends IOException
handler - the exception handler.
FsSyncException - If any exceptional condition occurs
throughout the processing of the container archive file.
X extends IOException
private <X extends IOException> void performSync(ExceptionHandler<? super FsSyncException,X> handler)
throws X extends IOException
handler - the exception handler.
IOException - If any exceptional condition occurs throughout the
processing of the container archive file.
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 IOException
private <X extends IOException> void commitSync(ExceptionHandler<? super FsSyncException,X> handler)
throws X extends IOException
handler - the exception handler.
FsSyncException - If any exceptional condition occurs
throughout the processing of the container archive file.
X extends IOExceptionprivate boolean isTouched()
|
TrueZIP Kernel 7.0-rc1 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||