public class X000A_NTFS extends java.lang.Object implements ZipExtraField
4.5.5 -NTFS Extra Field (0x000a): The following is the layout of the NTFS attributes "extra" block. (Note: At this time the Mtime, Atime and Ctime values MAY be used on any WIN32 system.) Note: all fields stored in Intel low-byte/high-byte order. Value Size Description ----- ---- ----------- (NTFS) 0x000a 2 bytes Tag for this "extra" block type TSize 2 bytes Size of the total "extra" block Reserved 4 bytes Reserved for future use Tag1 2 bytes NTFS attribute tag value #1 Size1 2 bytes Size of attribute #1, in bytes (var) Size1 Attribute #1 data . . . TagN 2 bytes NTFS attribute tag value #N SizeN 2 bytes Size of attribute #N, in bytes (var) SizeN Attribute #N data For NTFS, values for Tag1 through TagN are as follows: (currently only one set of attributes is defined for NTFS) Tag Size Description ----- ---- ----------- 0x0001 2 bytes Tag for attribute #1 Size1 2 bytes Size of attribute #1, in bytes Mtime 8 bytes File last modification time Atime 8 bytes File last access time Ctime 8 bytes File creation time
EXTRAFIELD_HEADER_SIZE
Constructor and Description |
---|
X000A_NTFS() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.util.Date |
getAccessJavaTime()
Returns the access time as a java.util.Date
of this zip entry, or null if no such timestamp exists in the zip entry.
|
ZipEightByteInteger |
getAccessTime()
Returns the "File last access time" of this zip entry as a
ZipEightByteInteger object, or
ZipEightByteInteger.ZERO
if no such timestamp exists in the zip entry. |
byte[] |
getCentralDirectoryData()
The actual data to put into central directory data - without Header-ID
or length specifier.
|
ZipShort |
getCentralDirectoryLength()
Length of the extra field in the local file data - without
Header-ID or length specifier.
|
java.util.Date |
getCreateJavaTime()
Returns the create time as a a java.util.Date of this zip
entry, or null if no such timestamp exists in the zip entry.
|
ZipEightByteInteger |
getCreateTime()
Returns the "File creation time" of this zip entry as a
ZipEightByteInteger object, or
ZipEightByteInteger.ZERO
if no such timestamp exists in the zip entry. |
ZipShort |
getHeaderId()
The Header-ID.
|
byte[] |
getLocalFileDataData()
The actual data to put into local file data - without Header-ID
or length specifier.
|
ZipShort |
getLocalFileDataLength()
Length of the extra field in the local file data - without
Header-ID or length specifier.
|
java.util.Date |
getModifyJavaTime()
Returns the modify time as a java.util.Date
of this zip entry, or null if no such timestamp exists in the zip entry.
|
ZipEightByteInteger |
getModifyTime()
Returns the "File last modification time" of this zip entry as
a ZipEightByteInteger object, or
ZipEightByteInteger.ZERO if no such timestamp exists in the
zip entry. |
int |
hashCode() |
void |
parseFromCentralDirectoryData(byte[] buffer,
int offset,
int length)
Doesn't do anything special since this class always uses the
same parsing logic for both central directory and local file data.
|
void |
parseFromLocalFileData(byte[] data,
int offset,
int length)
Populate data from this array as if it was in local file data.
|
void |
setAccessJavaTime(java.util.Date d)
Sets the access time as a java.util.Date
of this zip entry.
|
void |
setAccessTime(ZipEightByteInteger t)
Sets the File last access time of this zip entry using a
ZipEightByteInteger object.
|
void |
setCreateJavaTime(java.util.Date d)
Sets the create time as a java.util.Date
of this zip entry.
|
void |
setCreateTime(ZipEightByteInteger t)
Sets the File creation time of this zip entry using a
ZipEightByteInteger object.
|
void |
setModifyJavaTime(java.util.Date d)
Sets the modify time as a java.util.Date of this zip entry.
|
void |
setModifyTime(ZipEightByteInteger t)
Sets the File last modification time of this zip entry using a
ZipEightByteInteger object.
|
java.lang.String |
toString()
Returns a String representation of this class useful for
debugging purposes.
|
public ZipShort getHeaderId()
getHeaderId
in interface ZipExtraField
public ZipShort getLocalFileDataLength()
getLocalFileDataLength
in interface ZipExtraField
ZipShort
for the length of the data of this extra fieldpublic ZipShort getCentralDirectoryLength()
For X5455 the central length is often smaller than the local length, because central cannot contain access or create timestamps.
getCentralDirectoryLength
in interface ZipExtraField
ZipShort
for the length of the data of this extra fieldpublic byte[] getLocalFileDataData()
getLocalFileDataData
in interface ZipExtraField
public byte[] getCentralDirectoryData()
getCentralDirectoryData
in interface ZipExtraField
public void parseFromLocalFileData(byte[] data, int offset, int length) throws java.util.zip.ZipException
parseFromLocalFileData
in interface ZipExtraField
data
- an array of bytesoffset
- the start offsetlength
- the number of bytes in the array from offsetjava.util.zip.ZipException
- on errorpublic void parseFromCentralDirectoryData(byte[] buffer, int offset, int length) throws java.util.zip.ZipException
parseFromCentralDirectoryData
in interface ZipExtraField
buffer
- the buffer to read data fromoffset
- offset into buffer to read datalength
- the length of datajava.util.zip.ZipException
- on errorpublic ZipEightByteInteger getModifyTime()
ZipEightByteInteger.ZERO
if no such timestamp exists in the
zip entry.public ZipEightByteInteger getAccessTime()
ZipEightByteInteger.ZERO
if no such timestamp exists in the zip entry.public ZipEightByteInteger getCreateTime()
ZipEightByteInteger.ZERO
if no such timestamp exists in the zip entry.public java.util.Date getModifyJavaTime()
public java.util.Date getAccessJavaTime()
public java.util.Date getCreateJavaTime()
public void setModifyTime(ZipEightByteInteger t)
t
- ZipEightByteInteger of the modify timepublic void setAccessTime(ZipEightByteInteger t)
t
- ZipEightByteInteger of the access timepublic void setCreateTime(ZipEightByteInteger t)
t
- ZipEightByteInteger of the create timepublic void setModifyJavaTime(java.util.Date d)
d
- modify time as java.util.Datepublic void setAccessJavaTime(java.util.Date d)
d
- access time as java.util.Datepublic void setCreateJavaTime(java.util.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.
d
- create time as java.util.Datepublic java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2010 - 2020 Adobe. All Rights Reserved