|
TrueZIP 6.8 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.schlichtherle.io.archive.spi.AbstractArchiveDriver
public abstract class AbstractArchiveDriver
An abstract archive driver implementation to ease the task of developing an archive driver. It provides default implementations for character sets and icon handling.
Since TrueZIP 6.4, this class is serializable in order to meet the
requirements of the File class.
| Nested Class Summary | |
|---|---|
protected static class |
AbstractArchiveDriver.InconsistentCharsetSupportError
Thrown to indicate that the character set implementation in the Java Runtime Environment (JRE) for the Java Standard Edition (JSE) is broken and needs fixing. |
| Constructor Summary | |
|---|---|
protected |
AbstractArchiveDriver(String charset,
Icon openIcon,
Icon closedIcon)
Constructs a new abstract archive driver. |
| Method Summary | |
|---|---|
protected void |
ensureEncodable(String entryName)
Ensures that the given entry name is representable in this driver's character set charset. |
String |
getCharset()
Returns the value of the property charset which was
provided to the constructor. |
Icon |
getClosedIcon(Archive archive)
Returns the value of the property closedIcon which was
provided to the constructor. |
String |
getEncoding()
Deprecated. Use getCharset() instead. |
Icon |
getOpenIcon(Archive archive)
Returns the value of the property openIcon which was
provided to the constructor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface de.schlichtherle.io.archive.spi.ArchiveDriver |
|---|
createArchiveEntry, createInputArchive, createOutputArchive, equals, hashCode |
| Constructor Detail |
|---|
protected AbstractArchiveDriver(String charset,
Icon openIcon,
Icon closedIcon)
charset - The name of a character set to use by default for all
entry names and probably other meta data when reading or writing
archive files.openIcon - The icon to return by getOpenIcon(de.schlichtherle.io.archive.Archive).
May be null.closedIcon - The icon to return by getClosedIcon(de.schlichtherle.io.archive.Archive).
May be null.
NullPointerException - If charset is
null.
UnsupportedCharsetException - If charset is not
supported by both the JSE 1.1 API and JSE 1.4 API.
AbstractArchiveDriver.InconsistentCharsetSupportError - If charset is
supported by the JSE 1.1 API, but not the JSE 1.4 API,
or vice versa.| Method Detail |
|---|
protected final void ensureEncodable(String entryName)
throws CharConversionException
ArchiveDriver.createArchiveEntry(de.schlichtherle.io.archive.Archive, java.lang.String, de.schlichtherle.io.archive.spi.ArchiveEntry).
entryName - A valid archive entry name - null is not
permissible.
CharConversionException - If the entry name contains characters
which cannot get encoded.getCharset(),
Requirements for Archive Entry Namespublic final String getCharset()
charset which was
provided to the constructor.
public final String getEncoding()
getCharset() instead.
public final Icon getOpenIcon(Archive archive)
openIcon which was
provided to the constructor.
getOpenIcon in interface ArchiveDriverarchive - Ignored.
null is returned, a default icon should be used.public final Icon getClosedIcon(Archive archive)
closedIcon which was
provided to the constructor.
getClosedIcon in interface ArchiveDriverarchive - Ignored.
null is returned, a default icon should be used.
|
TrueZIP 6.8 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||