E
- the type of the archive entries.@Immutable public abstract class FsCharsetArchiveDriver<E extends FsArchiveEntry> extends FsArchiveDriver<E>
Subclasses must be thread-safe and should be immutable!
Modifier | Constructor and Description |
---|---|
protected |
FsCharsetArchiveDriver(Charset charset)
Constructs a new character set archive driver.
|
Modifier and Type | Method and Description |
---|---|
protected void |
assertEncodable(String name)
Ensures that the given entry name can get encoded by this driver's
character set.
|
Charset |
getCharset()
Returns the character set provided to the constructor.
|
String |
toString()
Returns a string representation of this object for debugging and logging
purposes.
|
static String |
toZipOrTarEntryName(String name,
Entry.Type type)
Fixes the given entry
name so that it forms a valid entry name
for ZIP or TAR files by ensuring that the returned entry name ends with
the separator character '/' if and only if type is
DIRECTORY . |
getInputSocket, getOutputSocket, getPool, getRedundantContentSupport, getRedundantMetaDataSupport, isFederated, newController, newController, newEntry, newEntry, newInputShop, newOutputShop
getPriority
protected FsCharsetArchiveDriver(Charset charset)
charset
- the character set to use for encoding entry names and
probably other meta data when writing an archive file.
Depending on the archive file format, this may get used for
reading an archive file, too.protected final void assertEncodable(String name) throws CharConversionException
The implementation in the class FsArchiveDriver
is just a stub
and does nothing.
The implementation in the class FsCharsetArchiveDriver
uses the
driver's character set for the check.
assertEncodable
in class FsArchiveDriver<E extends FsArchiveEntry>
name
- an entry name.CharConversionException
- If the entry name contains characters
which cannot get encoded.public Charset getCharset()
public String toString()
public static String toZipOrTarEntryName(String name, Entry.Type type)
name
so that it forms a valid entry name
for ZIP or TAR files by ensuring that the returned entry name ends with
the separator character '/'
if and only if type
is
DIRECTORY
.name
- an entry name.type
- an entry type.Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.