@Immutable public class TarDriver extends FsArchiveDriver<TarDriverEntry>
Subclasses must be thread-safe and should be immutable!
Modifier and Type | Field and Description |
---|---|
static Charset |
TAR_CHARSET
The character set for entry names and comments, which is the default
character set.
|
Constructor and Description |
---|
TarDriver() |
Modifier and Type | Method and Description |
---|---|
boolean |
getAddPaxHeaderForNonAsciiNames()
Returns
true if writing PAX headers for non US-ASCII entry names
should be supported or not. |
int |
getBigNumberMode()
Returns the method to use for writing entries of more than
TarConstants.MAXSIZE (8 GiB) size. |
Charset |
getCharset()
Returns the character set to use for encoding character based meta data
such as entry names or file comments to binary data when writing
an archive file.
|
int |
getLongFileMode()
Returns the method to use for encoding entry names with
TarConstants.NAMELEN or more characters. |
net.java.truecommons.cio.IoBufferPool |
getPool()
Returns the pool for allocating temporary I/O buffers.
|
boolean |
getRedundantContentSupport()
Returns
true if and only if the archive files produced by this
archive driver may contain redundant archive entry contents. |
TarDriverEntry |
newEntry(net.java.truecommons.shed.BitField<FsAccessOption> options,
String name,
net.java.truecommons.cio.Entry.Type type,
net.java.truecommons.cio.Entry template)
Returns a new entry for the given name.
|
TarDriverEntry |
newEntry(String name) |
TarDriverEntry |
newEntry(String name,
TarArchiveEntry template) |
protected net.java.truecommons.cio.InputService<TarDriverEntry> |
newInput(FsModel model,
FsInputSocketSource source)
Creates a new input service for reading archive entries for the given
model from the target archive file referenced by source . |
protected net.java.truecommons.cio.OutputService<TarDriverEntry> |
newOutput(FsModel model,
FsOutputSocketSink sink,
net.java.truecommons.cio.InputService<TarDriverEntry> input)
Creates a new input service for writing archive entries for the given
model to the target archive file referenced by sink . |
protected FsOutputSocketSink |
sink(net.java.truecommons.shed.BitField<FsAccessOption> options,
FsController controller,
FsNodeName name)
|
protected FsInputSocketSource |
source(net.java.truecommons.shed.BitField<FsAccessOption> options,
FsController controller,
FsNodeName name)
|
checkEncodable, decorate, getRedundantMetaDataSupport, isArchiveDriver, newController, newEntry, newInput, newOutput, normalize, toString
public static final Charset TAR_CHARSET
public boolean getAddPaxHeaderForNonAsciiNames()
true
if writing PAX headers for non US-ASCII entry names
should be supported or not.
As of TrueVFS 0.10.7, the implementation in TarDriver
returns
true
.
In older versions, the behaviour was as if this method returned
false
.public int getBigNumberMode()
TarConstants.MAXSIZE
(8 GiB) size.
As of TrueVFS 0.10.7, the implementation in TarDriver
returns
TarArchiveOutputStream.BIGNUMBER_POSIX
.
In older versions, the behaviour was as if this method returned
TarArchiveOutputStream.BIGNUMBER_ERROR
.public Charset getCharset()
This is an immutable property - multiple calls must return the same object.
getCharset
in class FsArchiveDriver<TarDriverEntry>
TAR_CHARSET
.public int getLongFileMode()
TarConstants.NAMELEN
or more characters.
As of TrueVFS 0.10.7, the implementation in TarDriver
returns
TarArchiveOutputStream.LONGFILE_POSIX
.
In older versions, the implementation returned
TarArchiveOutputStream.LONGFILE_GNU
.public net.java.truecommons.cio.IoBufferPool getPool()
This is an immutable property - multiple calls must return the same object.
The implementation in the class TarDriver
calls
IoBufferPoolLocator.SINGLETON.get()
.
getPool
in class FsArchiveDriver<TarDriverEntry>
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.
This is an immutable property - multiple calls must return the same value.
The default value of this property is false
as defined by the
implementation in the class FsArchiveDriver
.
getRedundantContentSupport
in class FsArchiveDriver<TarDriverEntry>
TarDriver
returns
true
because when reading a TAR file sequentially,
each TAR entry should "override" any previously read
TAR entry with an equal name.public TarDriverEntry newEntry(net.java.truecommons.shed.BitField<FsAccessOption> options, String name, net.java.truecommons.cio.Entry.Type type, @CheckForNull net.java.truecommons.cio.Entry template)
FsArchiveDriver
entry name
for their particular requirements.newEntry
in class FsArchiveDriver<TarDriverEntry>
options
- when called from FsController.make(net.java.truecommons.shed.BitField<net.java.truevfs.kernel.spec.FsAccessOption>, net.java.truevfs.kernel.spec.FsNodeName, net.java.truecommons.cio.Entry.Type, net.java.truecommons.cio.Entry)
, this is its
options
parameter, otherwise it's typically an empty set.name
- the entry name.type
- the 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.FsArchiveDriver.newEntry(String, Entry.Type, Entry)
public TarDriverEntry newEntry(String name)
public TarDriverEntry newEntry(String name, TarArchiveEntry template)
protected net.java.truecommons.cio.InputService<TarDriverEntry> newInput(FsModel model, FsInputSocketSource source) throws IOException
FsArchiveDriver
model
from the target archive file referenced by source
.newInput
in class FsArchiveDriver<TarDriverEntry>
model
- the file system model.source
- the source for reading the target archive file.IOException
- on any I/O error.FsArchiveDriver.newInput(FsModel, BitField, FsController, FsNodeName)
protected net.java.truecommons.cio.OutputService<TarDriverEntry> newOutput(FsModel model, FsOutputSocketSink sink, @CheckForNull @WillNotClose net.java.truecommons.cio.InputService<TarDriverEntry> input) throws IOException
FsArchiveDriver
model
to the target archive file referenced by sink
.newOutput
in class FsArchiveDriver<TarDriverEntry>
model
- the file system model.sink
- the sink for writing the target archive file.input
- the nullable InputService
for the target archive
file.
If not null
, then the target archive file is going to
get updated.
This parameter is guaranteed to be the product of this driver's
factory method
FsArchiveDriver.newInput(FsModel, BitField, FsController, FsNodeName)
.IOException
- on any I/O error.FsArchiveDriver.newOutput(FsModel, BitField, FsController, FsNodeName, InputService)
protected FsOutputSocketSink sink(net.java.truecommons.shed.BitField<FsAccessOption> options, FsController controller, FsNodeName name)
sink
in class FsArchiveDriver<TarDriverEntry>
options
- the options for accessing the file system node.controller
- the controller to use for writing an artifact of this
driver.name
- the node name.FsArchiveDriver.newOutput(FsModel, BitField, FsController, FsNodeName, InputService)
protected FsInputSocketSource source(net.java.truecommons.shed.BitField<FsAccessOption> options, FsController controller, FsNodeName name)
source
in class FsArchiveDriver<TarDriverEntry>
options
- the options for accessing the file system node.controller
- the controller to use for reading an artifact of this
driver.name
- the node name.FsArchiveDriver.newInput(FsModel, BitField, FsController, FsNodeName)
Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.