Package org.apache.tools.zip
Class AbstractUnicodeExtraField
- java.lang.Object
- 
- org.apache.tools.zip.AbstractUnicodeExtraField
 
- 
- All Implemented Interfaces:
- ZipExtraField
 - Direct Known Subclasses:
- UnicodeCommentExtraField,- UnicodePathExtraField
 
 public abstract class AbstractUnicodeExtraField extends java.lang.Object implements ZipExtraField A common base class for Unicode extra information extra fields.
- 
- 
Constructor SummaryConstructors Modifier Constructor Description protectedAbstractUnicodeExtraField()protectedAbstractUnicodeExtraField(java.lang.String text, byte[] bytes)Assemble as unicode extension from the name/comment and encoding of the original zip entry.protectedAbstractUnicodeExtraField(java.lang.String text, byte[] bytes, int off, int len)Assemble as unicode extension from the name/comment and encoding of the original zip entry.
 - 
Method SummaryModifier and Type Method Description byte[]getCentralDirectoryData()The actual data to put into central directory - without Header-ID or length specifier.ZipShortgetCentralDirectoryLength()Length of the extra field in the central directory - without Header-ID or length specifier.byte[]getLocalFileDataData()The actual data to put into local file data - without Header-ID or length specifier.ZipShortgetLocalFileDataLength()Length of the extra field in the local file data - without Header-ID or length specifier.longgetNameCRC32()byte[]getUnicodeName()voidparseFromLocalFileData(byte[] buffer, int offset, int length)Populate data from this array as if it was in local file data.voidsetNameCRC32(long nameCRC32)voidsetUnicodeName(byte[] unicodeName)- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.apache.tools.zip.ZipExtraFieldgetHeaderId
 
- 
 
- 
- 
- 
Constructor Detail- 
AbstractUnicodeExtraFieldprotected AbstractUnicodeExtraField() 
 - 
AbstractUnicodeExtraFieldprotected AbstractUnicodeExtraField(java.lang.String text, byte[] bytes, int off, int len)Assemble as unicode extension from the name/comment and encoding of the original zip entry.- Parameters:
- text- The file name or comment.
- bytes- The encoded of the filename or comment in the zip file.
- off- The offset of the encoded filename or comment in- bytes.
- len- The length of the encoded filename or comment in- bytes.
 
 - 
AbstractUnicodeExtraFieldprotected AbstractUnicodeExtraField(java.lang.String text, byte[] bytes)Assemble as unicode extension from the name/comment and encoding of the original zip entry.- Parameters:
- text- The file name or comment.
- bytes- The encoded of the filename or comment in the zip file.
 
 
- 
 - 
Method Detail- 
getNameCRC32public long getNameCRC32() - Returns:
- The CRC32 checksum of the filename or comment as encoded in the central directory of the zip file.
 
 - 
setNameCRC32public void setNameCRC32(long nameCRC32) - Parameters:
- nameCRC32- The CRC32 checksum of the filename as encoded in the central directory of the zip file to set.
 
 - 
getUnicodeNamepublic byte[] getUnicodeName() - Returns:
- The utf-8 encoded name.
 
 - 
setUnicodeNamepublic void setUnicodeName(byte[] unicodeName) - Parameters:
- unicodeName- The utf-8 encoded name to set.
 
 - 
getCentralDirectoryDatapublic byte[] getCentralDirectoryData() The actual data to put into central directory - without Header-ID or length specifier.- Specified by:
- getCentralDirectoryDatain interface- ZipExtraField
- Returns:
- the data
 
 - 
getCentralDirectoryLengthpublic ZipShort getCentralDirectoryLength() Length of the extra field in the central directory - without Header-ID or length specifier.- Specified by:
- getCentralDirectoryLengthin interface- ZipExtraField
- Returns:
- the length of the field in the central directory
 
 - 
getLocalFileDataDatapublic byte[] getLocalFileDataData() The actual data to put into local file data - without Header-ID or length specifier.- Specified by:
- getLocalFileDataDatain interface- ZipExtraField
- Returns:
- the data
 
 - 
getLocalFileDataLengthpublic ZipShort getLocalFileDataLength() Length of the extra field in the local file data - without Header-ID or length specifier.- Specified by:
- getLocalFileDataLengthin interface- ZipExtraField
- Returns:
- the length of the field in the local file data
 
 - 
parseFromLocalFileDatapublic void parseFromLocalFileData(byte[] buffer, int offset, int length) throws java.util.zip.ZipExceptionPopulate data from this array as if it was in local file data.- Specified by:
- parseFromLocalFileDatain interface- ZipExtraField
- Parameters:
- buffer- an array of bytes
- offset- the start offset
- length- the number of bytes in the array from offset
- Throws:
- java.util.zip.ZipException- on error
 
 
- 
 
-