|
TrueZIP Kernel 7.0-rc2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.schlichtherle.truezip.fs.FsDriver
de.schlichtherle.truezip.fs.archive.FsArchiveDriver<E>
de.schlichtherle.truezip.fs.archive.FsCharsetArchiveDriver<E>
@Immutable @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public abstract class FsCharsetArchiveDriver<E extends FsArchiveEntry>
An abstract base class of an archive driver which provides convenient methods for dealing with the character set supported by a particular archive type. This class is intended to be used to implement archive types with a defined character set, e.g. the ZIP file format with its IBM437 character set or the TAR file format with its US-ASCII character set.
Implementations must be immutable.
| Nested Class Summary | |
|---|---|
private class |
FsCharsetArchiveDriver.ThreadLocalEncoder
|
| Field Summary | |
|---|---|
private Charset |
charset
|
private FsCharsetArchiveDriver.ThreadLocalEncoder |
encoder
|
| Constructor Summary | |
|---|---|
protected |
FsCharsetArchiveDriver(Charset charset)
Constructs a new character set archive driver. |
| Method Summary | |
|---|---|
protected void |
assertEncodable(String name)
Ensures that the given entry name can be 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. |
protected 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. |
| Methods inherited from class de.schlichtherle.truezip.fs.archive.FsArchiveDriver |
|---|
getClosedIcon, getOpenIcon, getPool, isFederated, newController, newInputShop, newOutputShop |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface de.schlichtherle.truezip.entry.EntryFactory |
|---|
newEntry |
| Field Detail |
|---|
private final Charset charset
private final FsCharsetArchiveDriver.ThreadLocalEncoder encoder
| Constructor Detail |
|---|
protected FsCharsetArchiveDriver(Charset charset)
charset - the character set to use for encoding entry names and
probably other meta data when reading or writing an archive file.| Method Detail |
|---|
public Charset getCharset()
protected static String toZipOrTarEntryName(String name,
Entry.Type type)
'/' if and only if type is
DIRECTORY.
name - an entry name.type - an entry type.
protected final void assertEncodable(String name)
throws CharConversionException
EntryFactory.newEntry(java.lang.String, de.schlichtherle.truezip.entry.Entry.Type, de.schlichtherle.truezip.entry.Entry).
name - an entry name.
CharConversionException - If the path name contains characters
which cannot get encoded.getCharset()public String toString()
toString in class FsDriver
|
TrueZIP Kernel 7.0-rc2 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||