Top Description Fields Constructors Methods
org.apache.commons.compress.archivers.zip

public Class X5455_ExtendedTimestamp

extends Object
implements ZipExtraField, Cloneable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Cloneable, org.apache.commons.compress.archivers.zip.ZipExtraField
Imports
java.io.Serializable, java.nio.file.attribute.FileTime, java.util.Arrays, .Date, .Objects, java.util.zip.ZipException, org.apache.commons.compress.utils.TimeUtils

An extra field that stores additional file and directory timestamp data for ZIP entries. Each ZIP entry can include up to three timestamps (modify, access, create*). The timestamps are stored as 32 bit signed integers representing seconds since UNIX epoch (Jan 1st, 1970, UTC). This field improves on ZIP's default timestamp granularity, since it allows one to store additional timestamps, and, in addition, the timestamps are stored using per-second granularity (zip's default behavior can only store timestamps to the nearest even second).

Unfortunately, 32 (signed) bits can only store dates up to the year 2037, and so this extra field will eventually be obsolete. Enjoy it while it lasts!

We're using the field definition given in Info-Zip's source archive: zip-3.0.tar.gz/proginfo/extrafld.txt

Value         Size        Description
-----         ----        -----------
0x5455        Short       tag for this extra block type ("UT")
TSize         Short       total data size for this block
Flags         Byte        info bits
(ModTime)     Long        time of last modification (UTC/GMT)
(AcTime)      Long        time of last access (UTC/GMT)
(CrTime)      Long        time of original creation (UTC/GMT)

Central-header version:

Value         Size        Description
-----         ----        -----------
0x5455        Short       tag for this extra block type ("UT")
TSize         Short       total data size for this block
Flags         Byte        info bits (refers to local header!)
(ModTime)     Long        time of last modification (UTC/GMT)
Since
1.5

Field Summary

Modifier and TypeField and Description
public static final byte
ACCESS_TIME_BIT

The bit set inside the flags by when the lasr access time is present in this extra field.

private ZipLong
private boolean
private boolean
private boolean
public static final byte
CREATE_TIME_BIT

The bit set inside the flags by when the original creation time is present in this extra field.

private ZipLong
private byte
public static final ZipShort
HEADER_ID

The header ID for this extra field.

public static final byte
MODIFY_TIME_BIT

The bit set inside the flags by when the last modification time is present in this extra field.

private ZipLong
private static final long

Constructor Summary

AccessConstructor and Description
public
X5455_ExtendedTimestamp()

Constructor for X5455_ExtendedTimestamp.

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
private static ZipLong

Returns:

ZipLong
dateToZipLong
(final Date
java.util.Date to convert to ZipLong
d
)

Utility method converts java.util.Date (milliseconds since epoch) into a ZipLong (seconds since epoch).

public boolean
equals(final Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
private static ZipLong

Returns:

ZipLong
fileTimeToZipLong
(final FileTime
FileTime to convert to ZipLong
time
)

Utility method converts FileTime into a ZipLong (seconds since epoch).

public FileTime

Returns:

modify time as FileTime or null.
getAccessFileTime
()

Gets the access time as a FileTime of this ZIP entry, or null if no such timestamp exists in the ZIP entry.

public Date

Returns:

access time as java.util.Date or null.
getAccessJavaTime
()

Gets the access time as a java.util.Date of this ZIP entry, or null if no such timestamp exists in the ZIP entry.

public ZipLong

Returns:

access time (seconds since epoch) or null.
getAccessTime
()

Gets the access time (seconds since epoch) of this ZIP entry as a ZipLong object, or null if no such timestamp exists in the ZIP entry.

public byte[]

Returns:

the central directory data
getCentralDirectoryData
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getCentralDirectoryData.

Gets the actual data to put into central directory data - without Header-ID or length specifier.
public ZipShort

Returns:

a ZipShort for the length of the data of this extra field
getCentralDirectoryLength
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getCentralDirectoryLength.

Gets the length of the extra field in the local file data - without Header-ID or length specifier.
public FileTime

Returns:

modify time as FileTime or null.
getCreateFileTime
()

Gets the create time as a FileTime of this ZIP entry, or null if no such timestamp exists in the ZIP entry.

public Date

Returns:

create time as java.util.Date or null.
getCreateJavaTime
()

Gets the create time as a java.util.Date of this ZIP entry, or null if no such timestamp exists in the ZIP entry.

public ZipLong

Returns:

create time (seconds since epoch) or null.
getCreateTime
()

Gets the create time (seconds since epoch) of this ZIP entry as a ZipLong object, or null if no such timestamp exists in the ZIP entry.

public byte

Returns:

flags byte indicating which of the three datestamp fields are present.
getFlags
()

Gets flags byte.

public ZipShort

Returns:

the value for the header id for this extrafield
getHeaderId
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getHeaderId.

Gets the Header-ID.
public byte[]

Returns:

get the data
getLocalFileDataData
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getLocalFileDataData.

Gets the actual data to put into local file data - without Header-ID or length specifier.
public ZipShort

Returns:

a ZipShort for the length of the data of this extra field
getLocalFileDataLength
()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getLocalFileDataLength.

Gets the length of the extra field in the local file data - without Header-ID or length specifier.
public FileTime

Returns:

modify time as FileTime or null.
getModifyFileTime
()

Gets the modify time as a FileTime of this ZIP entry, or null if no such timestamp exists in the ZIP entry.

public Date

Returns:

modify time as java.util.Date or null.
getModifyJavaTime
()

Gets the modify time as a java.util.Date of this ZIP entry, or null if no such timestamp exists in the ZIP entry.

public ZipLong

Returns:

modify time (seconds since epoch) or null.
getModifyTime
()

Gets the modify time (seconds since epoch) of this ZIP entry as a ZipLong object, or null if no such timestamp exists in the ZIP entry.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean

Returns:

true if bit0 of the flags byte is set.
isBit0_modifyTimePresent
()

Tests whether bit0 of the flags byte is set or not, which should correspond to the presence or absence of a modify timestamp in this particular ZIP entry.

public boolean

Returns:

true if bit1 of the flags byte is set.
isBit1_accessTimePresent
()

Tests whether bit1 of the flags byte is set or not, which should correspond to the presence or absence of a "last access" timestamp in this particular ZIP entry.

public boolean

Returns:

true if bit2 of the flags byte is set.
isBit2_createTimePresent
()

Tests whether bit2 of the flags byte is set or not, which should correspond to the presence or absence of a create timestamp in this particular ZIP entry.

public void
parseFromCentralDirectoryData(final byte[]
the buffer to read data from
buffer
,
final int
offset into buffer to read data
offset
,
final int
the length of data
length
)

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

Doesn't do anything special since this class always uses the same parsing logic for both central directory and local file data.
public void
parseFromLocalFileData(final byte[]
an array of bytes
data
,
int
the start offset
offset
,
final int
the number of bytes in the array from offset
length
)

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromLocalFileData.

Populate data from this array as if it was in local file data.
private void
reset()

Reset state back to newly constructed state.

public void
setAccessFileTime(final FileTime
access time as FileTime
time
)

Sets the acccess time as a FileTime of this ZIP entry.

public void
setAccessJavaTime(final Date
access time as java.util.Date
d
)

Sets the access time as a java.util.Date of this ZIP entry.

public void
setAccessTime(final ZipLong
ZipLong of the access time (seconds per epoch)
l
)

Sets the access time (seconds since epoch) of this ZIP entry using a ZipLong object

Note: the setters for flags and timestamps are decoupled.

public void
setCreateFileTime(final FileTime
create time as FileTime
time
)

Sets the create time as a FileTime of this ZIP entry.

public void
setCreateJavaTime(final Date
create time as java.util.Date
d
)

Sets the create time as a java.util.Date of this ZIP entry.

public void
setCreateTime(final ZipLong
ZipLong of the create time (seconds per epoch)
l
)

Sets the create time (seconds since epoch) of this ZIP entry using a ZipLong object

Note: the setters for flags and timestamps are decoupled.

public void
setFlags(final byte
flags byte indicating which of the three datestamp fields are present.
flags
)

Sets flags byte.

public void
setModifyFileTime(final FileTime
modify time as FileTime
time
)

Sets the modify time as a FileTime of this ZIP entry.

public void
setModifyJavaTime(final Date
modify time as java.util.Date
d
)

Sets the modify time as a java.util.Date of this ZIP entry.

public void
setModifyTime(final ZipLong
ZipLong of the modify time (seconds per epoch)
l
)

Sets the modify time (seconds since epoch) of this ZIP entry using a ZipLong object.

public String

Returns:

A String representation of this class useful for debugging purposes.
toString
()

Overrides java.lang.Object.toString.

Returns a String representation of this class useful for debugging purposes.
private static FileTime
unixTimeToFileTime(final ZipLong unixTime)

private static ZipLong
unixTimeToZipLong(final long unixTime)

private static Date
zipLongToDate(final ZipLong unixTime)

Inherited from java.lang.Object:
finalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

ACCESS_TIME_BITback to summary
public static final byte ACCESS_TIME_BIT

The bit set inside the flags by when the lasr access time is present in this extra field.

accessTimeback to summary
private ZipLong accessTime
bit0_modifyTimePresentback to summary
private boolean bit0_modifyTimePresent
bit1_accessTimePresentback to summary
private boolean bit1_accessTimePresent
bit2_createTimePresentback to summary
private boolean bit2_createTimePresent
CREATE_TIME_BITback to summary
public static final byte CREATE_TIME_BIT

The bit set inside the flags by when the original creation time is present in this extra field.

createTimeback to summary
private ZipLong createTime
flagsback to summary
private byte flags
HEADER_IDback to summary
public static final ZipShort HEADER_ID

The header ID for this extra field.

Since
1.23
MODIFY_TIME_BITback to summary
public static final byte MODIFY_TIME_BIT

The bit set inside the flags by when the last modification time is present in this extra field.

modifyTimeback to summary
private ZipLong modifyTime
serialVersionUIDback to summary
private static final long serialVersionUID

Constructor Detail

X5455_ExtendedTimestampback to summary
public X5455_ExtendedTimestamp()

Constructor for X5455_ExtendedTimestamp.

Method Detail

cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a clone of this instance.

Annotations
@Override
Exceptions
CloneNotSupportedException:
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
dateToZipLongback to summary
private static ZipLong dateToZipLong(final Date d)

Utility method converts java.util.Date (milliseconds since epoch) into a ZipLong (seconds since epoch).

Also makes sure the converted ZipLong is not too big to fit in 32 unsigned bits.

Parameters
d:Date

java.util.Date to convert to ZipLong

Returns:ZipLong

ZipLong

equalsback to summary
public boolean equals(final Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
fileTimeToZipLongback to summary
private static ZipLong fileTimeToZipLong(final FileTime time)

Utility method converts FileTime into a ZipLong (seconds since epoch).

Also makes sure the converted ZipLong is not too big to fit in 32 unsigned bits.

Parameters
time:FileTime

FileTime to convert to ZipLong

Returns:ZipLong

ZipLong

getAccessFileTimeback to summary
public FileTime getAccessFileTime()

Gets the access time as a FileTime of this ZIP entry, or null if no such timestamp exists in the ZIP entry. The milliseconds are always zeroed out, since the underlying data offers only per-second precision.

Returns:FileTime

modify time as FileTime or null.

Since
1.23
getAccessJavaTimeback to summary
public Date getAccessJavaTime()

Gets the access time as a java.util.Date of this ZIP entry, or null if no such timestamp exists in the ZIP entry. The milliseconds are always zeroed out, since the underlying data offers only per-second precision.

Returns:Date

access time as java.util.Date or null.

getAccessTimeback to summary
public ZipLong getAccessTime()

Gets the access time (seconds since epoch) of this ZIP entry as a ZipLong object, or null if no such timestamp exists in the ZIP entry.

Returns:ZipLong

access time (seconds since epoch) or null.

getCentralDirectoryDataback to summary
public byte[] getCentralDirectoryData()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getCentralDirectoryData.

Gets the actual data to put into central directory data - without Header-ID or length specifier.

Returns:byte[]

the central directory data

Annotations
@Override
getCentralDirectoryLengthback to summary
public ZipShort getCentralDirectoryLength()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getCentralDirectoryLength.

Gets the length of the extra field in the local file data - without Header-ID or length specifier.

For X5455 the central length is often smaller than the local length, because central cannot contain access or create timestamps.

Returns:ZipShort

a ZipShort for the length of the data of this extra field

Annotations
@Override
getCreateFileTimeback to summary
public FileTime getCreateFileTime()

Gets the create time as a FileTime of this ZIP entry, or null if no such timestamp exists in the ZIP entry. The milliseconds are always zeroed out, since the underlying data offers only per-second precision.

Returns:FileTime

modify time as FileTime or null.

Since
1.23
getCreateJavaTimeback to summary
public Date getCreateJavaTime()

Gets the create time as a java.util.Date of this ZIP entry, or null if no such timestamp exists in the ZIP entry. The milliseconds are always zeroed out, since the underlying data offers only per-second precision.

Note

modern Linux file systems (e.g., ext2) do not appear to store a "create time" value, and so it's usually omitted altogether in the ZIP extra field. Perhaps other Unix systems track this.

Returns:Date

create time as java.util.Date or null.

getCreateTimeback to summary
public ZipLong getCreateTime()

Gets the create time (seconds since epoch) of this ZIP entry as a ZipLong object, or null if no such timestamp exists in the ZIP entry.

Note

modern Linux file systems (e.g., ext2) do not appear to store a "create time" value, and so it's usually omitted altogether in the ZIP extra field. Perhaps other Unix systems track this.

Returns:ZipLong

create time (seconds since epoch) or null.

getFlagsback to summary
public byte getFlags()

Gets flags byte. The flags byte tells us which of the three datestamp fields are present in the data:

bit0 - modify time
bit1 - access time
bit2 - create time
Only first 3 bits of flags are used according to the latest version of the spec (December 2012).
Returns:byte

flags byte indicating which of the three datestamp fields are present.

getHeaderIdback to summary
public ZipShort getHeaderId()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getHeaderId.

Gets the Header-ID.

Returns:ZipShort

the value for the header id for this extrafield

Annotations
@Override
getLocalFileDataDataback to summary
public byte[] getLocalFileDataData()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getLocalFileDataData.

Gets the actual data to put into local file data - without Header-ID or length specifier.

Returns:byte[]

get the data

Annotations
@Override
getLocalFileDataLengthback to summary
public ZipShort getLocalFileDataLength()

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.getLocalFileDataLength.

Gets the length of the extra field in the local file data - without Header-ID or length specifier.

Returns:ZipShort

a ZipShort for the length of the data of this extra field

Annotations
@Override
getModifyFileTimeback to summary
public FileTime getModifyFileTime()

Gets the modify time as a FileTime of this ZIP entry, or null if no such timestamp exists in the ZIP entry. The milliseconds are always zeroed out, since the underlying data offers only per-second precision.

Returns:FileTime

modify time as FileTime or null.

Since
1.23
getModifyJavaTimeback to summary
public Date getModifyJavaTime()

Gets the modify time as a java.util.Date of this ZIP entry, or null if no such timestamp exists in the ZIP entry. The milliseconds are always zeroed out, since the underlying data offers only per-second precision.

Returns:Date

modify time as java.util.Date or null.

getModifyTimeback to summary
public ZipLong getModifyTime()

Gets the modify time (seconds since epoch) of this ZIP entry as a ZipLong object, or null if no such timestamp exists in the ZIP entry.

Returns:ZipLong

modify time (seconds since epoch) or null.

hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
isBit0_modifyTimePresentback to summary
public boolean isBit0_modifyTimePresent()

Tests whether bit0 of the flags byte is set or not, which should correspond to the presence or absence of a modify timestamp in this particular ZIP entry.

Returns:boolean

true if bit0 of the flags byte is set.

isBit1_accessTimePresentback to summary
public boolean isBit1_accessTimePresent()

Tests whether bit1 of the flags byte is set or not, which should correspond to the presence or absence of a "last access" timestamp in this particular ZIP entry.

Returns:boolean

true if bit1 of the flags byte is set.

isBit2_createTimePresentback to summary
public boolean isBit2_createTimePresent()

Tests whether bit2 of the flags byte is set or not, which should correspond to the presence or absence of a create timestamp in this particular ZIP entry.

Returns:boolean

true if bit2 of the flags byte is set.

parseFromCentralDirectoryDataback to summary
public void parseFromCentralDirectoryData(final byte[] buffer, final int offset, final int length) throws ZipException

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

Doesn't do anything special since this class always uses the same parsing logic for both central directory and local file data.

Parameters
buffer:byte[]

Doc from org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

the buffer to read data from

offset:int

Doc from org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

offset into buffer to read data

length:int

Doc from org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

the length of data

Annotations
@Override
Exceptions
ZipException:

Doc from org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromCentralDirectoryData.

on error

parseFromLocalFileDataback to summary
public void parseFromLocalFileData(final byte[] data, int offset, final int length) throws ZipException

Implements org.apache.commons.compress.archivers.zip.ZipExtraField.parseFromLocalFileData.

Populate data from this array as if it was in local file data.

Parameters
data:byte[]

an array of bytes

offset:int

the start offset

length:int

the number of bytes in the array from offset

Annotations
@Override
Exceptions
ZipException:
on error
resetback to summary
private void reset()

Reset state back to newly constructed state. Helps us make sure parse() calls always generate clean results.

setAccessFileTimeback to summary
public void setAccessFileTime(final FileTime time)

Sets the acccess time as a FileTime of this ZIP entry. Supplied value is truncated to per-second precision (milliseconds zeroed-out).

Note

the setters for flags and timestamps are decoupled. Even if the timestamp is not-null, it will only be written out if the corresponding bit in the flags is also set.

Parameters
time:FileTime

access time as FileTime

Since
1.23
setAccessJavaTimeback to summary
public void setAccessJavaTime(final Date d)

Sets the access time as a java.util.Date of this ZIP entry. Supplied value is truncated to per-second precision (milliseconds zeroed-out).

Note

the setters for flags and timestamps are decoupled. Even if the timestamp is not-null, it will only be written out if the corresponding bit in the flags is also set.

Parameters
d:Date

access time as java.util.Date

setAccessTimeback to summary
public void setAccessTime(final ZipLong l)

Sets the access time (seconds since epoch) of this ZIP entry using a ZipLong object

Note: the setters for flags and timestamps are decoupled. Even if the timestamp is not-null, it will only be written out if the corresponding bit in the flags is also set.

Parameters
l:ZipLong

ZipLong of the access time (seconds per epoch)

setCreateFileTimeback to summary
public void setCreateFileTime(final FileTime time)

Sets the create time as a FileTime of this ZIP entry. Supplied value is truncated to per-second precision (milliseconds zeroed-out).

Note

the setters for flags and timestamps are decoupled. Even if the timestamp is not-null, it will only be written out if the corresponding bit in the flags is also set.

Parameters
time:FileTime

create time as FileTime

Since
1.23
setCreateJavaTimeback to summary
public void setCreateJavaTime(final Date d)

Sets the create time as a java.util.Date of this ZIP entry. Supplied value is truncated to per-second precision (milliseconds zeroed-out).

Note

the setters for flags and timestamps are decoupled. Even if the timestamp is not-null, it will only be written out if the corresponding bit in the flags is also set.

Parameters
d:Date

create time as java.util.Date

setCreateTimeback to summary
public void setCreateTime(final ZipLong l)

Sets the create time (seconds since epoch) of this ZIP entry using a ZipLong object

Note: the setters for flags and timestamps are decoupled. Even if the timestamp is not-null, it will only be written out if the corresponding bit in the flags is also set.

Parameters
l:ZipLong

ZipLong of the create time (seconds per epoch)

setFlagsback to summary
public void setFlags(final byte flags)

Sets flags byte. The flags byte tells us which of the three datestamp fields are present in the data:

bit0 - modify time
bit1 - access time
bit2 - create time
Only first 3 bits of flags are used according to the latest version of the spec (December 2012).
Parameters
flags:byte

flags byte indicating which of the three datestamp fields are present.

setModifyFileTimeback to summary
public void setModifyFileTime(final FileTime time)

Sets the modify time as a FileTime of this ZIP entry. Supplied value is truncated to per-second precision (milliseconds zeroed-out).

Note

the setters for flags and timestamps are decoupled. Even if the timestamp is not-null, it will only be written out if the corresponding bit in the flags is also set.

Parameters
time:FileTime

modify time as FileTime

Since
1.23
setModifyJavaTimeback to summary
public void setModifyJavaTime(final Date d)

Sets the modify time as a java.util.Date of this ZIP entry. Supplied value is truncated to per-second precision (milliseconds zeroed-out).

Note

the setters for flags and timestamps are decoupled. Even if the timestamp is not-null, it will only be written out if the corresponding bit in the flags is also set.

Parameters
d:Date

modify time as java.util.Date

setModifyTimeback to summary
public void setModifyTime(final ZipLong l)

Sets the modify time (seconds since epoch) of this ZIP entry using a ZipLong object.

Note

the setters for flags and timestamps are decoupled. Even if the timestamp is not-null, it will only be written out if the corresponding bit in the flags is also set.

Parameters
l:ZipLong

ZipLong of the modify time (seconds per epoch)

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a String representation of this class useful for debugging purposes.

Returns:String

A String representation of this class useful for debugging purposes.

Annotations
@Override
unixTimeToFileTimeback to summary
private static FileTime unixTimeToFileTime(final ZipLong unixTime)
unixTimeToZipLongback to summary
private static ZipLong unixTimeToZipLong(final long unixTime)
zipLongToDateback to summary
private static Date zipLongToDate(final ZipLong unixTime)