Extension that adds better handling of extra fields and provides
access to the internal and external file attributes.
See also:
Constructors
protected ZipEntry
()
Since:
1.9
public ZipEntry
(java.lang.String name)
Creates a new zip entry with the specified name.
Creates a new zip entry with the specified name.
Parameters: - name - the name of the entry
Since:
1.1
public ZipEntry
(java.util.zip.ZipEntry entry)
throws
java.util.zip.ZipException
Creates a new zip entry with fields taken from the specified zip entry.
Creates a new zip entry with fields taken from the specified zip entry.
Parameters: - entry - the entry to get fields from
Throws: - java.util.zip.ZipException - on error
Since:
1.1
public ZipEntry
(ZipEntry entry)
throws
java.util.zip.ZipException
Creates a new zip entry with fields taken from the specified zip entry.
Creates a new zip entry with fields taken from the specified zip entry.
Parameters: - entry - the entry to get fields from
Throws: - java.util.zip.ZipException - on error
Since:
1.1
Adds an extra fields - replacing an already present extra field
of the same type.
Adds an extra fields - replacing an already present extra field of the same type.
Parameters: - ze - an extra field
Since:
1.1
public java.lang.Object
clone
()
[Overrides java.util.zip.ZipEntry]
Overwrite clone.
Overwrite clone.
Returns:
a cloned copy of this ZipEntry
Since:
1.1
public boolean
equals
(java.lang.Object o)
The equality method.
The equality method. In this case, the implementation returns 'this == o' which is basically the equals method of the Object class.
Returns:
true if this object is the same as o Parameters: - o - the object to compare to
Since:
Ant 1.7
public byte
getCentralDirectoryExtra
()
Retrieves the extra data for the central directory.
Retrieves the extra data for the central directory.
Returns:
the central directory extra data
Since:
1.1
public java.lang.String
getComment
()
[Inherited From java.util.zip.ZipEntry]
public long
getCompressedSize
()
[Inherited From java.util.zip.ZipEntry]
public long
getCrc
()
[Inherited From java.util.zip.ZipEntry]
public long
getExternalAttributes
()
Retrieves the external file attributes.
Retrieves the external file attributes.
Returns:
the external file attributes
Since:
1.1
public byte
getExtra
()
[Inherited From java.util.zip.ZipEntry]
Retrieves extra fields.
Returns:
an array of the extra fields
Since:
1.1
public int
getInternalAttributes
()
Retrieves the internal file attributes.
Retrieves the internal file attributes.
Returns:
the internal file attributes
Since:
1.1
public byte
getLocalFileDataExtra
()
Retrieves the extra data for the local file data.
Retrieves the extra data for the local file data.
Returns:
the extra data for local file
Since:
1.1
public int
getMethod
()
[Inherited From java.util.zip.ZipEntry]
public java.lang.String
getName
()
[Overrides java.util.zip.ZipEntry]
Get the name of the entry.
Get the name of the entry.
Returns:
the entry name
Since:
1.9
public int
getPlatform
()
Platform specification to put into the "version made
by" part of the central file header.
Platform specification to put into the "version made by" part of the central file header.
Returns:
0 (MS-DOS FAT) unless {@link #setUnixMode setUnixMode}
has been called, in which case 3 (Unix) will be returned.
Since:
Ant 1.5.2
public long
getSize
()
[Inherited From java.util.zip.ZipEntry]
public long
getTime
()
[Inherited From java.util.zip.ZipEntry]
public int
getUnixMode
()
Unix permission.
Unix permission.
Returns:
the unix permissions
Since:
Ant 1.6
public int
hashCode
()
[Overrides java.util.zip.ZipEntry]
Get the hashCode of the entry.
Get the hashCode of the entry. This uses the name as the hashcode.
Returns:
a hashcode.
Since:
Ant 1.7
public boolean
isDirectory
()
[Overrides java.util.zip.ZipEntry]
Is this entry a directory?
Is this entry a directory?
Returns:
true if the entry is a directory
Since:
1.10
Remove an extra fields.
Parameters: - type - the type of extra field to remove
Since:
1.1
public void
setComment
(java.lang.String arg0)
[Inherited From java.util.zip.ZipEntry]
public void
setCompressedSize
(long arg0)
[Inherited From java.util.zip.ZipEntry]
public void
setComprSize
(long size)
Make this class work in JDK 1.1 like a 1.2 class.
Make this class work in JDK 1.1 like a 1.2 class.
This either stores the size for later usage or invokes
setCompressedSize via reflection.
Parameters: - size - the size to use
Since:
1.2
public void
setCrc
(long arg0)
[Inherited From java.util.zip.ZipEntry]
public void
setExternalAttributes
(long value)
Sets the external file attributes.
Sets the external file attributes.
Parameters: - value - an long value
Since:
1.1
protected void
setExtra
()
Unfortunately 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.
Unfortunately 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
public void
setExtra
(byte[] extra)
throws
java.lang.RuntimeException[Overrides java.util.zip.ZipEntry]
Throws an Exception if extra data cannot be parsed into extra fields.
Throws an Exception if extra data cannot be parsed into extra fields.
Parameters: - extra - an array of bytes to be parsed into extra fields
Throws: - java.lang.RuntimeException - if the bytes cannot be parsed
- java.lang.RuntimeException - on error
Since:
1.1