public class X000A_NTFS extends 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
| Modifier and Type | Field and Description |
|---|---|
static ZipShort |
HEADER_ID
The header ID for this extra field.
|
EXTRAFIELD_HEADER_SIZE| Constructor and Description |
|---|
X000A_NTFS() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
FileTime |
getAccessFileTime()
Gets the access time as a
FileTime
of this ZIP entry, or null if no such timestamp exists in the ZIP entry. |
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.
|
ZipEightByteInteger |
getAccessTime()
Gets 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()
Gets the actual data to put into central directory data - without Header-ID
or length specifier.
|
ZipShort |
getCentralDirectoryLength()
Gets the length of the extra field in the local file data - without
Header-ID or length specifier.
|
FileTime |
getCreateFileTime()
Gets the create time as a
FileTime
of this ZIP entry, or null if no such timestamp exists in the ZIP entry. |
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.
|
ZipEightByteInteger |
getCreateTime()
Gets 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()
Gets the Header-ID.
|
byte[] |
getLocalFileDataData()
Gets the actual data to put into local file data - without Header-ID
or length specifier.
|
ZipShort |
getLocalFileDataLength()
Gets the length of the extra field in the local file data - without
Header-ID or length specifier.
|
FileTime |
getModifyFileTime()
Gets the modify time as a
FileTime
of this ZIP entry, or null if no such timestamp exists in the ZIP entry. |
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.
|
ZipEightByteInteger |
getModifyTime()
Gets 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 |
setAccessFileTime(FileTime time)
Sets the access time.
|
void |
setAccessJavaTime(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 |
setCreateFileTime(FileTime time)
Sets the create time.
|
void |
setCreateJavaTime(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 |
setModifyFileTime(FileTime time)
Sets the modify time.
|
void |
setModifyJavaTime(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.
|
String |
toString()
Returns a String representation of this class useful for
debugging purposes.
|
public X000A_NTFS()
public FileTime getAccessFileTime()
FileTime
of this ZIP entry, or null if no such timestamp exists in the ZIP entry.FileTime or null.public Date getAccessJavaTime()
public ZipEightByteInteger getAccessTime()
ZipEightByteInteger.ZERO
if no such timestamp exists in the ZIP entry.public byte[] getCentralDirectoryData()
getCentralDirectoryData in interface ZipExtraFieldpublic 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 ZipExtraFieldZipShort for the length of the data of this extra fieldpublic FileTime getCreateFileTime()
FileTime
of this ZIP entry, or null if no such timestamp exists in the ZIP entry.FileTime or null.public Date getCreateJavaTime()
public ZipEightByteInteger getCreateTime()
ZipEightByteInteger.ZERO
if no such timestamp exists in the ZIP entry.public ZipShort getHeaderId()
getHeaderId in interface ZipExtraFieldpublic byte[] getLocalFileDataData()
getLocalFileDataData in interface ZipExtraFieldpublic ZipShort getLocalFileDataLength()
getLocalFileDataLength in interface ZipExtraFieldZipShort for the length of the data of this extra fieldpublic FileTime getModifyFileTime()
FileTime
of this ZIP entry, or null if no such timestamp exists in the ZIP entry.FileTime or null.public Date getModifyJavaTime()
public ZipEightByteInteger getModifyTime()
ZipEightByteInteger.ZERO if no such timestamp exists in the
ZIP entry.public void parseFromCentralDirectoryData(byte[] buffer, int offset, int length) throws ZipException
parseFromCentralDirectoryData in interface ZipExtraFieldbuffer - the buffer to read data fromoffset - offset into buffer to read datalength - the length of dataZipException - on errorpublic void parseFromLocalFileData(byte[] data, int offset, int length) throws ZipException
parseFromLocalFileData in interface ZipExtraFielddata - an array of bytesoffset - the start offsetlength - the number of bytes in the array from offsetZipException - on errorpublic void setAccessFileTime(FileTime time)
time - access time as a FileTimepublic void setAccessJavaTime(Date d)
d - access time as java.util.Datepublic void setAccessTime(ZipEightByteInteger t)
t - ZipEightByteInteger of the access timepublic void setCreateFileTime(FileTime time)
time - create time as a FileTimepublic void setCreateJavaTime(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 void setCreateTime(ZipEightByteInteger t)
t - ZipEightByteInteger of the create timepublic void setModifyFileTime(FileTime time)
time - modify time as a FileTimepublic void setModifyJavaTime(Date d)
d - modify time as java.util.Datepublic void setModifyTime(ZipEightByteInteger t)
t - ZipEightByteInteger of the modify timeCopyright © 2002–2022 The Apache Software Foundation. All rights reserved.