You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by bo...@apache.org on 2009/02/26 18:05:42 UTC
svn commit: r748209 -
/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/
Author: bodewig
Date: Thu Feb 26 17:05:40 2009
New Revision: 748209
URL: http://svn.apache.org/viewvc?rev=748209&view=rev
Log:
remove meaningless @since tags, references to Ant and a single unused deprecated method
Modified:
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/JarMarker.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnicodeCommentExtraField.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnicodePathExtraField.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnixStat.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnrecognizedExtraField.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipExtraField.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java?rev=748209&r1=748208&r2=748209&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java (original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/AsiExtraField.java Thu Feb 26 17:05:40 2009
@@ -52,41 +52,29 @@
private static final int WORD = 4;
/**
* Standard Unix stat(2) file mode.
- *
- * @since 1.1
*/
private int mode = 0;
/**
* User ID.
- *
- * @since 1.1
*/
private int uid = 0;
/**
* Group ID.
- *
- * @since 1.1
*/
private int gid = 0;
/**
* File this entry points to, if it is a symbolic link.
*
* <p>empty string - if entry is not a symbolic link.</p>
- *
- * @since 1.1
*/
private String link = "";
/**
* Is this an entry for a directory?
- *
- * @since 1.1
*/
private boolean dirFlag = false;
/**
* Instance used to calculate checksums.
- *
- * @since 1.1
*/
private CRC32 crc = new CRC32();
@@ -97,7 +85,6 @@
/**
* The Header-ID.
* @return the value for the header id for this extrafield
- * @since 1.1
*/
public ZipShort getHeaderId() {
return HEADER_ID;
@@ -107,7 +94,6 @@
* Length of the extra field in the local file data - without
* Header-ID or length specifier.
* @return a <code>ZipShort</code> for the length of the data of this extra field
- * @since 1.1
*/
public ZipShort getLocalFileDataLength() {
return new ZipShort(WORD // CRC
@@ -121,7 +107,6 @@
/**
* Delegate to local file data.
* @return the centralDirectory length
- * @since 1.1
*/
public ZipShort getCentralDirectoryLength() {
return getLocalFileDataLength();
@@ -131,7 +116,6 @@
* The actual data to put into local file data - without Header-ID
* or length specifier.
* @return get the data
- * @since 1.1
*/
public byte[] getLocalFileDataData() {
// CRC will be added later
@@ -164,7 +148,6 @@
/**
* Delegate to local file data.
* @return the local file data
- * @since 1.1
*/
public byte[] getCentralDirectoryData() {
return getLocalFileDataData();
@@ -173,7 +156,6 @@
/**
* Set the user id.
* @param uid the user id
- * @since 1.1
*/
public void setUserId(int uid) {
this.uid = uid;
@@ -182,7 +164,6 @@
/**
* Get the user id.
* @return the user id
- * @since 1.1
*/
public int getUserId() {
return uid;
@@ -191,7 +172,6 @@
/**
* Set the group id.
* @param gid the group id
- * @since 1.1
*/
public void setGroupId(int gid) {
this.gid = gid;
@@ -200,7 +180,6 @@
/**
* Get the group id.
* @return the group id
- * @since 1.1
*/
public int getGroupId() {
return gid;
@@ -211,8 +190,6 @@
*
* @param name Name of the file this entry links to, empty String
* if it is not a symbolic link.
- *
- * @since 1.1
*/
public void setLinkedFile(String name) {
link = name;
@@ -224,8 +201,6 @@
*
* @return name of the file this entry links to if it is a
* symbolic link, the empty string otherwise.
- *
- * @since 1.1
*/
public String getLinkedFile() {
return link;
@@ -234,7 +209,6 @@
/**
* Is this entry a symbolic link?
* @return true if this is a symbolic link
- * @since 1.1
*/
public boolean isLink() {
return getLinkedFile().length() != 0;
@@ -243,7 +217,6 @@
/**
* File mode of this file.
* @param mode the file mode
- * @since 1.1
*/
public void setMode(int mode) {
this.mode = getMode(mode);
@@ -252,7 +225,6 @@
/**
* File mode of this file.
* @return the file mode
- * @since 1.1
*/
public int getMode() {
return mode;
@@ -261,7 +233,6 @@
/**
* Indicate whether this entry is a directory.
* @param dirFlag if true, this entry is a directory
- * @since 1.1
*/
public void setDirectory(boolean dirFlag) {
this.dirFlag = dirFlag;
@@ -271,7 +242,6 @@
/**
* Is this entry a directory?
* @return true if this entry is a directory
- * @since 1.1
*/
public boolean isDirectory() {
return dirFlag && !isLink();
@@ -282,7 +252,6 @@
* @param data an array of bytes
* @param offset the start offset
* @param length the number of bytes in the array from offset
- * @since 1.1
* @throws ZipException on error
*/
public void parseFromLocalFileData(byte[] data, int offset, int length)
@@ -322,7 +291,6 @@
* Get the file mode for given permissions with the correct file type.
* @param mode the mode
* @return the type with the mode
- * @since 1.1
*/
protected int getMode(int mode) {
int type = FILE_FLAG;
Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java?rev=748209&r1=748208&r2=748209&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java (original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ExtraFieldUtils.java Thu Feb 26 17:05:40 2009
@@ -34,8 +34,6 @@
/**
* Static registry of known extra fields.
- *
- * @since 1.1
*/
private static final Map implementations;
@@ -53,8 +51,6 @@
* <p>The given class must have a no-arg constructor and implement
* the {@link ZipExtraField ZipExtraField interface}.</p>
* @param c the class to register
- *
- * @since 1.1
*/
public static void register(Class c) {
try {
@@ -76,7 +72,6 @@
* @return an instance of the appropiate ExtraField
* @exception InstantiationException if unable to instantiate the class
* @exception IllegalAccessException if not allowed to instatiate the class
- * @since 1.1
*/
public static ZipExtraField createExtraField(ZipShort headerId)
throws InstantiationException, IllegalAccessException {
@@ -94,7 +89,6 @@
* give data.
* @param data an array of bytes
* @return an array of ExtraFields
- * @since 1.1
* @throws ZipException on error
*/
public static ZipExtraField[] parse(byte[] data) throws ZipException {
@@ -127,7 +121,6 @@
* Merges the local file data fields of the given ZipExtraFields.
* @param data an array of ExtraFiles
* @return an array of bytes
- * @since 1.1
*/
public static byte[] mergeLocalFileDataData(ZipExtraField[] data) {
int sum = WORD * data.length;
@@ -152,7 +145,6 @@
* Merges the central directory fields of the given ZipExtraFields.
* @param data an array of ExtraFields
* @return an array of bytes
- * @since 1.1
*/
public static byte[] mergeCentralDirectoryData(ZipExtraField[] data) {
int sum = WORD * data.length;
Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/JarMarker.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/JarMarker.java?rev=748209&r1=748208&r2=748209&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/JarMarker.java (original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/JarMarker.java Thu Feb 26 17:05:40 2009
@@ -22,8 +22,6 @@
/**
* If this extra field is added as the very first extra field of the
* archive, Solaris will consider it an executable jar file.
- *
- * @since Ant 1.6.3
*/
public final class JarMarker implements ZipExtraField {
@@ -75,7 +73,6 @@
* The actual data to put into local file data - without Header-ID
* or length specifier.
* @return the data
- * @since 1.1
*/
public byte[] getLocalFileDataData() {
return NO_BYTES;
Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnicodeCommentExtraField.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnicodeCommentExtraField.java?rev=748209&r1=748208&r2=748209&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnicodeCommentExtraField.java (original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnicodeCommentExtraField.java Thu Feb 26 17:05:40 2009
@@ -43,7 +43,7 @@
/**
* Assemble as unicode comment extension from the comment and
- * encoding of the orginal zip entry.
+ * encoding of the original zip entry.
*
* @param comment The file comment
* @param zipEncoding The encoding of the comment in the zip file,
Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnicodePathExtraField.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnicodePathExtraField.java?rev=748209&r1=748208&r2=748209&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnicodePathExtraField.java (original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnicodePathExtraField.java Thu Feb 26 17:05:40 2009
@@ -43,7 +43,7 @@
/**
* Assemble as unicode path extension from the name and encoding
- * of the orginal zip entry.
+ * of the original zip entry.
*
* @param name The file name
* @param zipEncoding The encoding of the filename in the zip
Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnixStat.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnixStat.java?rev=748209&r1=748208&r2=748209&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnixStat.java (original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnixStat.java Thu Feb 26 17:05:40 2009
@@ -25,26 +25,18 @@
{
/**
* Bits used for permissions (and sticky bit)
- *
- * @since 1.1
*/
int PERM_MASK = 07777;
/**
* Indicates symbolic links.
- *
- * @since 1.1
*/
int LINK_FLAG = 0120000;
/**
* Indicates plain files.
- *
- * @since 1.1
*/
int FILE_FLAG = 0100000;
/**
* Indicates directories.
- *
- * @since 1.1
*/
int DIR_FLAG = 040000;
@@ -55,22 +47,16 @@
/**
* Default permissions for symbolic links.
- *
- * @since 1.1
*/
int DEFAULT_LINK_PERM = 0777;
/**
* Default permissions for directories.
- *
- * @since 1.1
*/
int DEFAULT_DIR_PERM = 0755;
/**
* Default permissions for plain files.
- *
- * @since 1.1
*/
int DEFAULT_FILE_PERM = 0644;
}
Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnrecognizedExtraField.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnrecognizedExtraField.java?rev=748209&r1=748208&r2=748209&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnrecognizedExtraField.java (original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/UnrecognizedExtraField.java Thu Feb 26 17:05:40 2009
@@ -30,23 +30,17 @@
/**
* Extra field data in central directory - without Header-ID or length
* specifier.
- *
- * @since 1.1
*/
private byte[] m_centralData;
/**
* The Header-ID.
- *
- * @since 1.1
*/
private ZipShort m_headerID;
/**
* Extra field data in local file data - without Header-ID or length
* specifier.
- *
- * @since 1.1
*/
private byte[] m_localData;
Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java?rev=748209&r1=748208&r2=748209&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java (original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveEntry.java Thu Feb 26 17:05:40 2009
@@ -43,7 +43,6 @@
/**
* Creates a new zip entry with the specified name.
* @param name the name of the entry
- * @since 1.1
*/
public ZipArchiveEntry(String name) {
super(name);
@@ -52,7 +51,6 @@
/**
* Creates a new zip entry with fields taken from the specified zip entry.
* @param entry the entry to get fields from
- * @since 1.1
* @throws ZipException on error
*/
public ZipArchiveEntry(java.util.zip.ZipEntry entry) throws ZipException {
@@ -70,7 +68,6 @@
* Creates a new zip entry with fields taken from the specified zip entry.
* @param entry the entry to get fields from
* @throws ZipException on error
- * @since 1.1
*/
public ZipArchiveEntry(ZipArchiveEntry entry) throws ZipException {
this((java.util.zip.ZipEntry) entry);
@@ -80,7 +77,6 @@
}
/**
- * @since 1.9
*/
protected ZipArchiveEntry() {
super("");
@@ -89,7 +85,6 @@
/**
* Overwrite clone.
* @return a cloned copy of this ZipArchiveEntry
- * @since 1.1
*/
public Object clone() {
ZipArchiveEntry e = (ZipArchiveEntry) super.clone();
@@ -105,7 +100,6 @@
* Retrieves the internal file attributes.
*
* @return the internal file attributes
- * @since 1.1
*/
public int getInternalAttributes() {
return internalAttributes;
@@ -114,7 +108,6 @@
/**
* Sets the internal file attributes.
* @param value an <code>int</code> value
- * @since 1.1
*/
public void setInternalAttributes(int value) {
internalAttributes = value;
@@ -123,7 +116,6 @@
/**
* Retrieves the external file attributes.
* @return the external file attributes
- * @since 1.1
*/
public long getExternalAttributes() {
return externalAttributes;
@@ -132,7 +124,6 @@
/**
* Sets the external file attributes.
* @param value an <code>long</code> value
- * @since 1.1
*/
public void setExternalAttributes(long value) {
externalAttributes = value;
@@ -142,7 +133,6 @@
* Sets Unix permissions in a way that is understood by Info-Zip's
* unzip command.
* @param mode an <code>int</code> value
- * @since Ant 1.5.2
*/
public void setUnixMode(int mode) {
// CheckStyle:MagicNumberCheck OFF - no point
@@ -158,7 +148,6 @@
/**
* Unix permission.
* @return the unix permissions
- * @since Ant 1.6
*/
public int getUnixMode() {
return platform != PLATFORM_UNIX ? 0 :
@@ -171,8 +160,6 @@
*
* @return PLATFORM_FAT unless {@link #setUnixMode setUnixMode}
* has been called, in which case PLATORM_UNIX will be returned.
- *
- * @since Ant 1.5.2
*/
public int getPlatform() {
return platform;
@@ -181,7 +168,6 @@
/**
* Set the platform (UNIX or FAT).
* @param platform an <code>int</code> value - 0 is FAT, 3 is UNIX
- * @since 1.9
*/
protected void setPlatform(int platform) {
this.platform = platform;
@@ -190,7 +176,6 @@
/**
* Replaces all currently attached extra fields with the new array.
* @param fields an array of extra fields
- * @since 1.1
*/
public void setExtraFields(ZipExtraField[] fields) {
extraFields = new LinkedHashMap();
@@ -203,7 +188,6 @@
/**
* Retrieves extra fields.
* @return an array of the extra fields
- * @since 1.1
*/
public ZipExtraField[] getExtraFields() {
if (extraFields == null) {
@@ -220,7 +204,6 @@
* <p>If no extra field of the same type exists, the field will be
* added as last field.</p>
* @param ze an extra field
- * @since 1.1
*/
public void addExtraField(ZipExtraField ze) {
if (extraFields == null) {
@@ -236,7 +219,6 @@
*
* <p>The new extra field will be the first one.</p>
* @param ze an extra field
- * @since 1.1
*/
public void addAsFirstExtraField(ZipExtraField ze) {
LinkedHashMap copy = extraFields;
@@ -252,7 +234,6 @@
/**
* Remove an extra fields.
* @param type the type of extra field to remove
- * @since 1.1
*/
public void removeExtraField(ZipShort type) {
if (extraFields == null) {
@@ -280,7 +261,6 @@
* Throws an Exception if extra data cannot be parsed into extra fields.
* @param extra an array of bytes to be parsed into extra fields
* @throws RuntimeException if the bytes cannot be parsed
- * @since 1.1
* @throws RuntimeException on error
*/
public void setExtra(byte[] extra) throws RuntimeException {
@@ -296,8 +276,6 @@
* java.util.zip.ZipOutputStream} seems to access the extra data
* directly, so overriding getExtra doesn't help - we need to
* modify super's data directly.
- *
- * @since 1.1
*/
protected void setExtra() {
super.setExtra(ExtraFieldUtils.mergeLocalFileDataData(getExtraFields()));
@@ -306,7 +284,6 @@
/**
* Retrieves the extra data for the local file data.
* @return the extra data for local file
- * @since 1.1
*/
public byte[] getLocalFileDataExtra() {
byte[] extra = getExtra();
@@ -316,30 +293,14 @@
/**
* Retrieves the extra data for the central directory.
* @return the central directory extra data
- * @since 1.1
*/
public byte[] getCentralDirectoryExtra() {
return ExtraFieldUtils.mergeCentralDirectoryData(getExtraFields());
}
/**
- * Make this class work in JDK 1.1 like a 1.2 class.
- *
- * <p>This either stores the size for later usage or invokes
- * setCompressedSize via reflection.</p>
- * @param size the size to use
- * @deprecated since 1.7.
- * Use setCompressedSize directly.
- * @since 1.2
- */
- public void setComprSize(long size) {
- setCompressedSize(size);
- }
-
- /**
* Get the name of the entry.
* @return the entry name
- * @since 1.9
*/
public String getName() {
return name == null ? super.getName() : name;
@@ -348,7 +309,6 @@
/**
* Is this entry a directory?
* @return true if the entry is a directory
- * @since 1.10
*/
public boolean isDirectory() {
return getName().endsWith("/");
@@ -366,7 +326,6 @@
* Get the hashCode of the entry.
* This uses the name as the hashcode.
* @return a hashcode.
- * @since Ant 1.7
*/
public int hashCode() {
// this method has severe consequences on performance. We cannot rely
@@ -381,7 +340,6 @@
* which is basically the equals method of the Object class.
* @param o the object to compare to
* @return true if this object is the same as <code>o</code>
- * @since Ant 1.7
*/
public boolean equals(Object o) {
return (this == o);
Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java?rev=748209&r1=748208&r2=748209&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java (original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveOutputStream.java Thu Feb 26 17:05:40 2009
@@ -74,22 +74,16 @@
/**
* Compression method for deflated entries.
- *
- * @since 1.1
*/
public static final int DEFLATED = java.util.zip.ZipEntry.DEFLATED;
/**
* Default compression level for deflated entries.
- *
- * @since Ant 1.7
*/
public static final int DEFAULT_COMPRESSION = Deflater.DEFAULT_COMPRESSION;
/**
* Compression method for stored entries.
- *
- * @since 1.1
*/
public static final int STORED = java.util.zip.ZipEntry.STORED;
@@ -111,108 +105,78 @@
/**
* Current entry.
- *
- * @since 1.1
*/
private ZipArchiveEntry entry;
/**
* The file comment.
- *
- * @since 1.1
*/
private String comment = "";
/**
* Compression level for next entry.
- *
- * @since 1.1
*/
private int level = DEFAULT_COMPRESSION;
/**
* Has the compression level changed when compared to the last
* entry?
- *
- * @since 1.5
*/
private boolean hasCompressionLevelChanged = false;
/**
* Default compression method for next entry.
- *
- * @since 1.1
*/
private int method = java.util.zip.ZipEntry.DEFLATED;
/**
- * List of ZipEntries written so far.
- *
- * @since 1.1
+ * List of ZipArchiveEntries written so far.
*/
private final List entries = new LinkedList();
/**
* CRC instance to avoid parsing DEFLATED data twice.
- *
- * @since 1.1
*/
private final CRC32 crc = new CRC32();
/**
* Count the bytes written to out.
- *
- * @since 1.1
*/
private long written = 0;
/**
* Data for local header data
- *
- * @since 1.1
*/
private long dataStart = 0;
/**
* Offset for CRC entry in the local file header data for the
* current entry starts here.
- *
- * @since 1.15
*/
private long localDataStart = 0;
/**
* Start of central directory.
- *
- * @since 1.1
*/
private long cdOffset = 0;
/**
* Length of central directory.
- *
- * @since 1.1
*/
private long cdLength = 0;
/**
* Helper, a 0 as ZipShort.
- *
- * @since 1.1
*/
private static final byte[] ZERO = {0, 0};
/**
* Helper, a 0 as ZipLong.
- *
- * @since 1.1
*/
private static final byte[] LZERO = {0, 0, 0, 0};
/**
* Holds the offsets of the LFH starts for each entry.
- *
- * @since 1.1
*/
private final Map offsets = new HashMap();
@@ -222,8 +186,6 @@
* <p>For a list of possible values see <a
* href="http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html">http://java.sun.com/j2se/1.5.0/docs/guide/intl/encoding.doc.html</a>.
* Defaults to UTF-8.</p>
- *
- * @since 1.3
*/
private String encoding = DEFAULT_ENCODING;
@@ -236,8 +198,6 @@
* backwards compatibility. This class used to extend {@link
* java.util.zip.DeflaterOutputStream DeflaterOutputStream} up to
* Revision 1.13.</p>
- *
- * @since 1.14
*/
protected Deflater def = new Deflater(level, true);
@@ -248,8 +208,6 @@
* backwards compatibility. This class used to extend {@link
* java.util.zip.DeflaterOutputStream DeflaterOutputStream} up to
* Revision 1.13.</p>
- *
- * @since 1.14
*/
protected byte[] buf = new byte[BUFFER_SIZE];
@@ -257,8 +215,6 @@
/**
* Optional random access output.
- *
- * @since 1.14
*/
private RandomAccessFile raf = null;
@@ -277,7 +233,6 @@
/**
* Creates a new ZIP OutputStream filtering the underlying stream.
* @param out the outputstream to zip
- * @since 1.1
*/
public ZipArchiveOutputStream(OutputStream out) {
this.out = out;
@@ -287,7 +242,6 @@
* Creates a new ZIP OutputStream writing to a File. Will use
* random access if possible.
* @param file the file to zip to
- * @since 1.14
* @throws IOException on error
*/
public ZipArchiveOutputStream(File file) throws IOException {
@@ -317,7 +271,6 @@
* uncompressed size for {@link #STORED} entries before
* invoking {@link #putNextEntry}.
* @return true if seekable
- * @since 1.17
*/
public boolean isSeekable() {
return raf != null;
@@ -331,7 +284,6 @@
* Defaults to UTF-8.</p>
* @param encoding the encoding to use for file names, use null
* for the platform's default encoding
- * @since 1.3
*/
public void setEncoding(final String encoding) {
this.encoding = encoding;
@@ -342,8 +294,6 @@
* The encoding to use for filenames and the file comment.
*
* @return null if using the platform's default character encoding.
- *
- * @since 1.3
*/
public String getEncoding() {
return encoding;
@@ -371,8 +321,6 @@
/**
* Finishs writing the contents and closes this as well as the
* underlying stream.
- *
- * @since 1.1
* @throws IOException on error
*/
public void finish() throws IOException {
@@ -389,8 +337,6 @@
/**
* Writes all necessary data for this entry.
- *
- * @since 1.1
* @throws IOException on error
*/
public void closeEntry() throws IOException {
@@ -457,7 +403,6 @@
/**
* Begin writing next entry.
* @param ze the entry to write
- * @since 1.1
* @throws IOException on error
*/
public void putNextEntry(ZipArchiveEntry ze) throws IOException {
@@ -498,7 +443,6 @@
/**
* Set the file comment.
* @param comment the comment
- * @since 1.1
*/
public void setComment(String comment) {
this.comment = comment;
@@ -510,7 +454,6 @@
* <p>Default is Deflater.DEFAULT_COMPRESSION.</p>
* @param level the compression level.
* @throws IllegalArgumentException if an invalid compression level is specified.
- * @since 1.1
*/
public void setLevel(int level) {
if (level < Deflater.DEFAULT_COMPRESSION
@@ -527,7 +470,6 @@
*
* <p>Default is DEFLATED.</p>
* @param method an <code>int</code> from java.util.zip.ZipEntry
- * @since 1.1
*/
public void setMethod(int method) {
this.method = method;
@@ -574,7 +516,6 @@
*
* <p>Delegates to the three arg method.</p>
* @param b the byte to write
- * @since 1.14
* @throws IOException on error
*/
public void write(int b) throws IOException {
@@ -588,7 +529,6 @@
* associated with the stream.
*
* @exception IOException if an I/O error occurs.
- * @since 1.14
*/
public void close() throws IOException {
finish();
@@ -606,7 +546,6 @@
* to be written out to the stream.
*
* @exception IOException if an I/O error occurs.
- * @since 1.14
*/
public void flush() throws IOException {
if (out != null) {
@@ -635,34 +574,24 @@
*/
/**
* local file header signature
- *
- * @since 1.1
*/
static final byte[] LFH_SIG = ZipLong.getBytes(0X04034B50L);
/**
* data descriptor signature
- *
- * @since 1.1
*/
static final byte[] DD_SIG = ZipLong.getBytes(0X08074B50L);
/**
* central file header signature
- *
- * @since 1.1
*/
static final byte[] CFH_SIG = ZipLong.getBytes(0X02014B50L);
/**
* end of central dir signature
- *
- * @since 1.1
*/
static final byte[] EOCD_SIG = ZipLong.getBytes(0X06054B50L);
/**
* Writes next block of compressed data to the output stream.
* @throws IOException on error
- *
- * @since 1.14
*/
protected final void deflate() throws IOException {
int len = def.deflate(buf, 0, buf.length);
@@ -675,8 +604,6 @@
* Writes the local file header entry
* @param ze the entry to write
* @throws IOException on error
- *
- * @since 1.1
*/
protected void writeLocalFileHeader(ZipArchiveEntry ze) throws IOException {
@@ -750,8 +677,6 @@
* Writes the data descriptor entry.
* @param ze the entry to write
* @throws IOException on error
- *
- * @since 1.1
*/
protected void writeDataDescriptor(ZipArchiveEntry ze) throws IOException {
if (ze.getMethod() != DEFLATED || raf != null) {
@@ -770,8 +695,6 @@
* Writes the central file header entry.
* @param ze the entry to write
* @throws IOException on error
- *
- * @since 1.1
*/
protected void writeCentralFileHeader(ZipArchiveEntry ze) throws IOException {
writeOut(CFH_SIG);
@@ -855,8 +778,6 @@
/**
* Writes the "End of central dir record".
* @throws IOException on error
- *
- * @since 1.1
*/
protected void writeCentralDirectoryEnd() throws IOException {
writeOut(EOCD_SIG);
@@ -882,8 +803,6 @@
/**
* Smallest date/time ZIP can handle.
- *
- * @since 1.1
*/
private static final byte[] DOS_TIME_MIN = ZipLong.getBytes(0x00002100L);
@@ -891,7 +810,6 @@
* Convert a Date object to a DOS date/time field.
* @param time the <code>Date</code> to convert
* @return the date as a <code>ZipLong</code>
- * @since 1.1
*/
protected static ZipLong toDosTime(Date time) {
return new ZipLong(toDosTime(time.getTime()));
@@ -903,7 +821,6 @@
* <p>Stolen from InfoZip's <code>fileio.c</code></p>
* @param t number of milliseconds since the epoch
* @return the date as a byte array
- * @since 1.26
*/
protected static byte[] toDosTime(long t) {
Date time = new Date(t);
@@ -930,8 +847,6 @@
* @param name the string to get bytes from
* @return the bytes as a byte array
* @throws ZipException on error
- *
- * @since 1.3
*/
protected byte[] getBytes(String name) throws ZipException {
if (encoding == null) {
@@ -955,8 +870,6 @@
* Write bytes to output or random access file.
* @param data the byte array to write
* @throws IOException on error
- *
- * @since 1.14
*/
protected final void writeOut(byte[] data) throws IOException {
writeOut(data, 0, data.length);
@@ -968,8 +881,6 @@
* @param offset the start position to write from
* @param length the number of bytes to write
* @throws IOException on error
- *
- * @since 1.14
*/
protected final void writeOut(byte[] data, int offset, int length)
throws IOException {
@@ -985,7 +896,6 @@
* has wrapped around and re-creates the original value.
* @param i the value to treat as unsigned int.
* @return the unsigned int as a long.
- * @since 1.34
*/
protected static long adjustToLong(int i) {
if (i < 0) {
Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipExtraField.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipExtraField.java?rev=748209&r1=748208&r2=748209&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipExtraField.java (original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipExtraField.java Thu Feb 26 17:05:40 2009
@@ -34,7 +34,6 @@
* The Header-ID.
*
* @return The HeaderId value
- * @since 1.1
*/
ZipShort getHeaderId();
@@ -43,7 +42,6 @@
* length specifier.
*
* @return The LocalFileDataLength value
- * @since 1.1
*/
ZipShort getLocalFileDataLength();
@@ -52,7 +50,6 @@
* length specifier.
*
* @return The CentralDirectoryLength value
- * @since 1.1
*/
ZipShort getCentralDirectoryLength();
@@ -61,7 +58,6 @@
* specifier.
*
* @return The LocalFileDataData value
- * @since 1.1
*/
byte[] getLocalFileDataData();
@@ -70,7 +66,6 @@
* length specifier.
*
* @return The CentralDirectoryData value
- * @since 1.1
*/
byte[] getCentralDirectoryData();
@@ -81,7 +76,6 @@
* @param offset offset into buffer to read data
* @param length the length of data
* @exception ZipException on error
- * @since 1.1
*/
void parseFromLocalFileData( byte[] buffer, int offset, int length )
throws ZipException;
Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java?rev=748209&r1=748208&r2=748209&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java (original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java Thu Feb 26 17:05:40 2009
@@ -41,8 +41,8 @@
* (which is required to work on ZIP files created by native zip tools
* and is able to skip a preamble like the one found in self
* extracting archives. Furthermore it returns instances of
- * <code>org.apache.tools.zip.ZipArchiveEntry</code> instead of
- * <code>java.util.zip.ZipEntry</code>.</p>
+ * <code>org.apache.commons.compress.archivers.zip.ZipArchiveEntry</code>
+ * instead of <code>java.util.zip.ZipEntry</code>.</p>
*
* <p>It doesn't extend <code>java.util.zip.ZipFile</code> as it would
* have to reimplement all methods anyway. Like
@@ -56,7 +56,8 @@
* <li>There is no getName method.</li>
* <li>entries has been renamed to getEntries.</li>
* <li>getEntries and getEntry return
- * <code>org.apache.tools.zip.ZipArchiveEntry</code> instances.</li>
+ * <code>org.apache.commons.compress.archivers.zip.ZipArchiveEntry</code>
+ * instances.</li>
* <li>close is allowed to throw IOException.</li>
* </ul>
*
@@ -390,7 +391,7 @@
+ " central directory");
}
lenToSkip -= skipped;
- }
+ }
byte[] comment = new byte[commentLen];
archive.readFully(comment);
@@ -519,7 +520,7 @@
+ " local file header");
}
lenToSkip -= skipped;
- }
+ }
byte[] localExtraData = new byte[extraFieldLen];
archive.readFully(localExtraData);
ze.setExtra(localExtraData);
Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java?rev=748209&r1=748208&r2=748209&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java (original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipLong.java Thu Feb 26 17:05:40 2009
@@ -20,7 +20,6 @@
/**
* Utility class that represents a four byte integer with conversion
* rules for the big endian byte order of ZIP files.
- *
*/
public final class ZipLong implements Cloneable {
@@ -45,7 +44,6 @@
/**
* Create instance from a number.
* @param value the long to store as a ZipLong
- * @since 1.1
*/
public ZipLong(long value) {
this.value = value;
@@ -54,7 +52,6 @@
/**
* Create instance from bytes.
* @param bytes the bytes to store as a ZipLong
- * @since 1.1
*/
public ZipLong (byte[] bytes) {
this(bytes, 0);
@@ -64,7 +61,6 @@
* Create instance from the four bytes starting at offset.
* @param bytes the bytes to store as a ZipLong
* @param offset the offset to start
- * @since 1.1
*/
public ZipLong (byte[] bytes, int offset) {
value = ZipLong.getValue(bytes, offset);
@@ -72,7 +68,6 @@
/**
* Get value as four bytes in big endian byte order.
- * @since 1.1
* @return value as four bytes in big endian order
*/
public byte[] getBytes() {
@@ -81,7 +76,6 @@
/**
* Get value as Java long.
- * @since 1.1
* @return value as a long
*/
public long getValue() {
@@ -129,7 +123,6 @@
* Override to make two instances with same value equal.
* @param o an object to compare
* @return true if the objects are equal
- * @since 1.1
*/
public boolean equals(Object o) {
if (o == null || !(o instanceof ZipLong)) {
@@ -141,7 +134,6 @@
/**
* Override to make two instances with same value equal.
* @return the value stored in the ZipLong
- * @since 1.1
*/
public int hashCode() {
return (int) value;
Modified: commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java
URL: http://svn.apache.org/viewvc/commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java?rev=748209&r1=748208&r2=748209&view=diff
==============================================================================
--- commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java (original)
+++ commons/sandbox/compress/trunk/src/main/java/org/apache/commons/compress/archivers/zip/ZipShort.java Thu Feb 26 17:05:40 2009
@@ -32,7 +32,6 @@
/**
* Create instance from a number.
* @param value the int to store as a ZipShort
- * @since 1.1
*/
public ZipShort (int value) {
this.value = value;
@@ -41,7 +40,6 @@
/**
* Create instance from bytes.
* @param bytes the bytes to store as a ZipShort
- * @since 1.1
*/
public ZipShort (byte[] bytes) {
this(bytes, 0);
@@ -51,7 +49,6 @@
* Create instance from the two bytes starting at offset.
* @param bytes the bytes to store as a ZipShort
* @param offset the offset to start
- * @since 1.1
*/
public ZipShort (byte[] bytes, int offset) {
value = ZipShort.getValue(bytes, offset);
@@ -60,7 +57,6 @@
/**
* Get value as two bytes in big endian byte order.
* @return the value as a a two byte array in big endian byte order
- * @since 1.1
*/
public byte[] getBytes() {
byte[] result = new byte[2];
@@ -72,7 +68,6 @@
/**
* Get value as Java int.
* @return value as a Java int
- * @since 1.1
*/
public int getValue() {
return value;
@@ -115,7 +110,6 @@
* Override to make two instances with same value equal.
* @param o an object to compare
* @return true if the objects are equal
- * @since 1.1
*/
public boolean equals(Object o) {
if (o == null || !(o instanceof ZipShort)) {
@@ -127,7 +121,6 @@
/**
* Override to make two instances with same value equal.
* @return the value stored in the ZipShort
- * @since 1.1
*/
public int hashCode() {
return value;