|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.schlichtherle.util.zip.ZipEntry
public class ZipEntry
Drop-in replacement for java.util.zip.ZipEntry
.
For every numeric property of this class, the default value is
UNKNOWN
in order to indicate an unknown state and it's
permitted to set this value explicitly in order to reset the property.
Note that a ZipEntry
object can be used with only one
ZipFile
or ZipOutputStream
instance.
Reusing the same ZipEntry
object with a second object of these
classes is an error and may result in unpredictable behaviour.
In general, this class is not thread-safe. However, it is safe to call only the getters of this class from multiple threads concurrently.
Field Summary | |
---|---|
static int |
DEFLATED
Compression method for compressed (deflated) entries. |
static long |
MIN_DOS_TIME
Smallest supported DOS date/time value in a ZIP file, which is January 1st, 1980 AD 00:00:00 local time. |
static short |
PLATFORM_FAT
Windows/DOS/FAT platform. |
static short |
PLATFORM_UNIX
Unix platform. |
static int |
STORED
Compression method for uncompressed (stored) entries. |
static byte |
UNKNOWN
The unknown value for numeric properties. |
Constructor Summary | |
---|---|
ZipEntry(String name)
Creates a new zip entry with the specified name. |
|
ZipEntry(ZipEntry blueprint)
Creates a new zip blueprint with fields taken from the specified blueprint. |
Method Summary | |
---|---|
Object |
clone()
|
protected static long |
dos2javaTime(long dTime)
Deprecated. Use DateTimeConverter.toJavaTime(long) instead. |
String |
getComment()
|
long |
getCompressedSize()
Returns the Compressed Size of this entry. |
long |
getCrc()
|
protected DateTimeConverter |
getDateTimeConverter()
Returns a DateTimeConverter for the conversion of Java time
to DOS date/time fields and vice versa. |
protected long |
getDosTime()
|
byte[] |
getExtra()
Returns a protective copy of the serialized Extra Fields. |
int |
getMethod()
Returns the compression method for this entry. |
String |
getName()
Returns the ZIP entry name. |
short |
getPlatform()
|
long |
getSize()
Returns the (Uncompressed) Size of this entry. |
long |
getTime()
|
boolean |
isDirectory()
Returns true if and only if this ZIP entry represents a directory entry (i.e. end with '/' ). |
protected static long |
java2dosTime(long jTime)
Deprecated. Use DateTimeConverter.toDosTime(long) instead. |
void |
setComment(String comment)
|
void |
setCompressedSize(long csize)
Sets the Compressed Size of this entry. |
void |
setCrc(long crc)
|
protected void |
setDosTime(long dTime)
|
void |
setExtra(byte[] data)
Sets the serialized Extra Fields by making a protective copy. |
void |
setMethod(int method)
Sets the compression method for this entry. |
protected void |
setName(String name)
Resets the ZIP entry name. |
void |
setPlatform(short platform)
|
void |
setSize(long size)
Sets the (Uncompressed) Size of this entry. |
void |
setTime(long jTime)
|
String |
toString()
Returns the ZIP entry name. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte UNKNOWN
public static final short PLATFORM_FAT
public static final short PLATFORM_UNIX
public static final int STORED
public static final int DEFLATED
public static final long MIN_DOS_TIME
Constructor Detail |
---|
public ZipEntry(String name)
public ZipEntry(ZipEntry blueprint)
Method Detail |
---|
public Object clone()
clone
in class Object
public String getName()
protected void setName(String name)
copy constructor
or the clone()
method.
public boolean isDirectory()
'/'
).
public short getPlatform()
public void setPlatform(short platform)
public int getMethod()
setMethod(int)
,
ZipOutputStream.getMethod()
public void setMethod(int method)
RuntimeException
- If method
is not
STORED
, DEFLATED
or UNKNOWN
.getMethod()
,
ZipOutputStream.setMethod(int)
protected long getDosTime()
protected void setDosTime(long dTime)
public long getTime()
public void setTime(long jTime)
protected DateTimeConverter getDateTimeConverter()
DateTimeConverter
for the conversion of Java time
to DOS date/time fields and vice versa.
The implementation in the class ZipEntry
returns
DateTimeConverter.JAR
.
DateTimeConverter
- never null
.DateTimeConverter
public long getCrc()
public void setCrc(long crc)
public long getCompressedSize()
setCompressedSize(long)
public void setCompressedSize(long csize)
csize
- The Compressed Size.
RuntimeException
- If csize
is not in the
range from 0
to ULong.MAX_VALUE
(9223372036854775807L).getCompressedSize()
public long getSize()
setCompressedSize(long)
public void setSize(long size)
size
- The (Uncompressed) Size.
RuntimeException
- If size
is not in the
range from 0
to ULong.MAX_VALUE
(9223372036854775807L).getCompressedSize()
public byte[] getExtra()
ZipEntry.getExtra()
,
this method never returns null
.
null
is never returned.public void setExtra(byte[] data)
data
- The byte array holding the serialized Extra Fields.
May be null
.public String getComment()
public void setComment(String comment)
public String toString()
toString
in class Object
protected static long java2dosTime(long jTime)
DateTimeConverter.toDosTime(long)
instead.
DateTimeConverter.JAR
.toDosTime(jTime)
.
protected static long dos2javaTime(long dTime)
DateTimeConverter.toJavaTime(long)
instead.
DateTimeConverter.JAR
.toJavaTime(dTime)
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |