X000A_NTFS
Date: 2017-02-08

org.apache.commons.compress.archivers.zip

## Class X000A_NTFS

- java.lang.Object
- - org.apache.commons.compress.archivers.zip.X000A_NTFS

- All Implemented Interfaces:
    ZipExtraField

      public class X000A_NTFS
      extends java.lang.Object
      implements ZipExtraField

  NTFS extra field that was thought to store various attributes but in reality only stores timestamps.

          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

  Since:
    1.11

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `X000A_NTFS()`

  - ### Method Summary

    Methods
    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.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### X000A_NTFS

          public X000A_NTFS()

  - ### Method Detail

    - #### getHeaderId

          public ZipShort getHeaderId()

      The Header-ID.
      Specified by:
        `getHeaderId` in interface `ZipExtraField`
      Returns:
        the value for the header id for this extrafield

    - #### getLocalFileDataLength

          public ZipShort getLocalFileDataLength()

      Length of the extra field in the local file data - without Header-ID or length specifier.
      Specified by:
        `getLocalFileDataLength` in interface `ZipExtraField`
      Returns:
        a `ZipShort` for the length of the data of this extra field

    - #### getCentralDirectoryLength

          public ZipShort getCentralDirectoryLength()

      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.

      Specified by:
        `getCentralDirectoryLength` in interface `ZipExtraField`
      Returns:
        a `ZipShort` for the length of the data of this extra field

    - #### getLocalFileDataData

          public byte[] getLocalFileDataData()

      The actual data to put into local file data - without Header-ID or length specifier.
      Specified by:
        `getLocalFileDataData` in interface `ZipExtraField`
      Returns:
        get the data

    - #### getCentralDirectoryData

          public byte[] getCentralDirectoryData()

      The actual data to put into central directory data - without Header-ID or length specifier.
      Specified by:
        `getCentralDirectoryData` in interface `ZipExtraField`
      Returns:
        the central directory data

    - #### parseFromLocalFileData

          public void parseFromLocalFileData(byte[] data,
                                    int offset,
                                    int length)
                                      throws java.util.zip.ZipException

      Populate data from this array as if it was in local file data.
      Specified by:
        `parseFromLocalFileData` in interface `ZipExtraField`
      Parameters:
        `data` - an array of bytes
        `offset` - the start offset
        `length` - the number of bytes in the array from offset
      Throws:
        `java.util.zip.ZipException` - on error

    - #### parseFromCentralDirectoryData

          public void parseFromCentralDirectoryData(byte[] buffer,
                                           int offset,
                                           int length)
                                             throws java.util.zip.ZipException

      Doesn't do anything special since this class always uses the same parsing logic for both central directory and local file data.
      Specified by:
        `parseFromCentralDirectoryData` in interface `ZipExtraField`
      Parameters:
        `buffer` - the buffer to read data from
        `offset` - offset into buffer to read data
        `length` - the length of data
      Throws:
        `java.util.zip.ZipException` - on error

    - #### getModifyTime

          public 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.
      Returns:
        File last modification time

    - #### getAccessTime

          public 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.
      Returns:
        File last access time

    - #### getCreateTime

          public 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.
      Returns:
        File creation time

    - #### getModifyJavaTime

          public 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.
      Returns:
        modify time as java.util.Date or null.

    - #### getAccessJavaTime

          public 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.
      Returns:
        access time as java.util.Date or null.

    - #### getCreateJavaTime

          public 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.
      Returns:
        create time as java.util.Date or null.

    - #### setModifyTime

          public void setModifyTime(ZipEightByteInteger t)

      Sets the File last modification time of this zip entry using a ZipEightByteInteger object.
      Parameters:
        `t` - ZipEightByteInteger of the modify time

    - #### setAccessTime

          public void setAccessTime(ZipEightByteInteger t)

      Sets the File last access time of this zip entry using a ZipEightByteInteger object.
      Parameters:
        `t` - ZipEightByteInteger of the access time

    - #### setCreateTime

          public void setCreateTime(ZipEightByteInteger t)

      Sets the File creation time of this zip entry using a ZipEightByteInteger object.
      Parameters:
        `t` - ZipEightByteInteger of the create time

    - #### setModifyJavaTime

          public void setModifyJavaTime(java.util.Date d)

      Sets the modify time as a java.util.Date of this zip entry.
      Parameters:
        `d` - modify time as java.util.Date

    - #### setAccessJavaTime

          public void setAccessJavaTime(java.util.Date d)

      Sets the access time as a java.util.Date of this zip entry.
      Parameters:
        `d` - access time as java.util.Date

    - #### setCreateJavaTime

          public 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.

      Parameters:
        `d` - create time as java.util.Date

    - #### toString

          public java.lang.String toString()

      Returns a String representation of this class useful for debugging purposes.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns:
        A String representation of this class useful for debugging purposes.

    - #### equals

          public boolean equals(java.lang.Object o)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`