E - The type of the archive entries.@Immutable @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public abstract class FsArchiveDriver<E extends FsArchiveEntry> extends FsDriver
Sub-classes must be thread-safe and should be immutable.
| Constructor and Description |
|---|
FsArchiveDriver() |
| Modifier and Type | Method and Description |
|---|---|
Icon |
getClosedIcon(FsModel model)
Returns the icon that should be displayed for the given archive file
if it's closed/collapsed in the view.
|
InputSocket<?> |
getInputSocket(FsController<?> controller,
FsEntryName name,
BitField<FsInputOption> options)
Called to prepare reading an archive file artifact of this driver from
name in controller using options. |
Icon |
getOpenIcon(FsModel model)
Returns the icon that should be displayed for the given archive file
if it's open/expanded in the view.
|
OutputSocket<?> |
getOutputSocket(FsController<?> controller,
FsEntryName name,
BitField<FsOutputOption> options,
Entry template)
Called to prepare writing an archive file artifact of this driver to
name in controller using options and
template. |
protected abstract IOPool<?> |
getPool()
Returns the I/O pool to use for allocating temporary I/O entries.
|
boolean |
getRedundantContentSupport()
Returns
true if and only if the archive files produced by this
archive driver may contain redundant archive entry contents. |
boolean |
getRedundantMetaDataSupport()
Returns
true if and only if the archive files produced by this
archive driver may contain redundant archive entry meta data. |
boolean |
isFederated()
Returns
true iff this file system driver implements a federated
file system type, i.e. if the type of file system must be a member of a
parent file system. |
FsController<?> |
newController(FsModel model,
FsController<?> parent)
Returns a new thread-safe file system controller for the mount point of
the given file system model and parent file system controller.
|
E |
newEntry(String name,
Entry.Type type,
Entry template)
|
abstract E |
newEntry(String name,
Entry.Type type,
Entry template,
BitField<FsOutputOption> mknod)
Returns a new archive entry for the given name.
|
abstract InputShop<E> |
newInputShop(FsModel model,
InputSocket<?> input)
Creates a new input shop for reading the archive entries for the
given
model from the given input socket's target. |
abstract OutputShop<E> |
newOutputShop(FsModel model,
OutputSocket<?> output,
InputShop<E> source)
Creates a new output shop for writing archive entries for the
given
model to the given output socket's target. |
getPriority, toString@CheckForNull public Icon getClosedIcon(FsModel model)
The implementation in the abstract class FsArchiveDriver simply
returns null.
model - the file system model.null is returned, a default icon should be displayed.public InputSocket<?> getInputSocket(FsController<?> controller, FsEntryName name, BitField<FsInputOption> options)
name in controller using options.
This method should be overridden in order to modify the given options
before forwarding the call to the given controller.
The implementation in the class FsArchiveDriver simply forwards
the call to the given controller with the given options unaltered.
controller - the controller to use for reading an artifact of this
driver.name - the entry name.options - the options to use.@CheckForNull public Icon getOpenIcon(FsModel model)
The implementation in the abstract class FsArchiveDriver simply
returns null.
model - the file system model.null is returned, a default icon should be displayed.public OutputSocket<?> getOutputSocket(FsController<?> controller, FsEntryName name, BitField<FsOutputOption> options, @CheckForNull Entry template)
name in controller using options and
template.
This method should be overridden in order to modify the given options
before forwarding the call to the given controller.
The implementation in the class FsArchiveDriver simply forwards
the call to the given controller with the given options unaltered.
controller - the controller to use for writing an artifact of this
driver.name - the entry name.options - the options to use.template - the template to use.protected abstract IOPool<?> getPool()
public boolean getRedundantContentSupport()
true if and only if the archive files produced by this
archive driver may contain redundant archive entry contents.
If the return value is true, then an archive file may contain
redundant archive entry contents, but only the last contents written
should get used when reading the archive file.FsArchiveDriver returns
false for backwards compatibility.public boolean getRedundantMetaDataSupport()
true if and only if the archive files produced by this
archive driver may contain redundant archive entry meta data.
If the return value is true, then an archive file may contain
redundant archive entry meta data, but only the last meta data written
should get used when reading the archive file.
This usually implies the existence of a central directory in the
resulting archive file.FsArchiveDriver returns
false for backwards compatibility.public final boolean isFederated()
true iff this file system driver implements a federated
file system type, i.e. if the type of file system must be a member of a
parent file system.
The implementation in the class FsDriver returns false.
The implementation in the class FsArchiveDriver always returns
true.
This can't get overridden.
isFederated in class FsDrivertrue iff the type of the file system implemented by this
file system driver is federated, i.e. must be a member of a
parent file system.public FsController<?> newController(FsModel model, FsController<?> parent)
When called, the following expression is a precondition:
model.getParent().equals(parent.getModel())
Note that an archive file system is always federated and therefore
its parent file system controller is never null.
Furthermore, an archive driver implementation is not expected to consider the scheme of the given mount point to determine the class of the returned file system controller. Consequently, it is an error to call this method with a mount point which has a scheme which is not supported by this archive driver.
Note again that unlike the other components created by this factory, the returned file system controller must be thread-safe!
newController in class FsDrivermodel - the file system model.parent - the nullable parent file system controller.FsCompositeDriver.newController(de.schlichtherle.truezip.fs.FsModel, de.schlichtherle.truezip.fs.FsController<?>)public final E newEntry(String name, Entry.Type type, @CheckForNull Entry template) throws CharConversionException
CharConversionExceptionpublic abstract E newEntry(String name, Entry.Type type, @CheckForNull Entry template, BitField<FsOutputOption> mknod) throws CharConversionException
entry name for their
particular requirements.
If template is not null, then the returned entry shall
inherit as much properties from this template as possible - with the
exception of its name and type.
Furthermore, if name and type are equal to the name and
type of this template, then the returned entry shall be a (deep) clone
of the template which shares no mutable objects with the template.
name - an entry name.type - an entry type.template - if not null, then the new entry shall inherit
as much properties from this entry as possible - with the
exception of its name and type.mknod - when called from FsArchiveController.mknod(de.schlichtherle.truezip.fs.FsEntryName, de.schlichtherle.truezip.entry.Entry.Type, de.schlichtherle.truezip.util.BitField<de.schlichtherle.truezip.fs.FsOutputOption>, de.schlichtherle.truezip.entry.Entry), this
is its options parameter, otherwise it's typically an
empty set.CharConversionException - if name contains characters
which are invalid.public abstract InputShop<E> newInputShop(FsModel model, InputSocket<?> input) throws IOException
model from the given input socket's target.
Note that the returned input shop does not need to be thread-safe.
model - the file system model.input - the input socket for reading the contents of the
archive file from its target.
This is guaranteed to be the product of this driver's
getInputSocket(de.schlichtherle.truezip.fs.FsController<?>, de.schlichtherle.truezip.fs.FsEntryName, de.schlichtherle.truezip.util.BitField<de.schlichtherle.truezip.fs.FsInputOption>) method.IOException - on any I/O error.
If the file system entry for the given model exists in the
parent file system and is not of the type Entry.Type.SPECIAL,
then this exception is deemed to indicate a
permanent false positive archive file and gets cached
until the file system controller for the given model is
synced
again.
Otherwise, this exception is deemed to indicate a
preliminary false positive archive file and does not
get cached.public abstract OutputShop<E> newOutputShop(FsModel model, OutputSocket<?> output, @CheckForNull InputShop<E> source) throws IOException
model to the given output socket's target.
Note that the returned output shop does not need to be thread-safe.
model - the file system model.output - the output socket for writing the contents of the
archive file to its target.
This is guaranteed to be the product of this driver's
getOutputSocket(de.schlichtherle.truezip.fs.FsController<?>, de.schlichtherle.truezip.fs.FsEntryName, de.schlichtherle.truezip.util.BitField<de.schlichtherle.truezip.fs.FsOutputOption>, de.schlichtherle.truezip.entry.Entry) method.source - the InputShop if archive is going to get
updated.
If not null, this is guaranteed to be the product
of this driver's newInputShop(de.schlichtherle.truezip.fs.FsModel, de.schlichtherle.truezip.socket.InputSocket<?>) factory method.
This feature could get used to copy some meta data which is
specific to the type of archive this driver supports,
e.g. the comment of a ZIP file.IOException - on any I/O error.Copyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.