Class FileHeader


public class FileHeader extends BlockHeader
DOCUMENT ME
Version:
$LastChangedRevision$
  • Field Details

    • logger

      private static final org.slf4j.Logger logger
    • SALT_SIZE

      private static final byte SALT_SIZE
      See Also:
    • NEWLHD_SIZE

      private static final byte NEWLHD_SIZE
      See Also:
    • NANOS_PER_UNIT

      private static final long NANOS_PER_UNIT
      See Also:
    • unpSize

      private final long unpSize
    • hostOS

      private final HostSystem hostOS
    • fileCRC

      private final int fileCRC
    • unpVersion

      private byte unpVersion
    • unpMethod

      private byte unpMethod
    • nameSize

      private short nameSize
    • highPackSize

      private final int highPackSize
    • highUnpackSize

      private int highUnpackSize
    • fileNameBytes

      private final byte[] fileNameBytes
    • fileName

      private String fileName
    • fileNameW

      private String fileNameW
    • subData

      private byte[] subData
    • salt

      private final byte[] salt
    • mTime

      private FileTime mTime
    • cTime

      private FileTime cTime
    • aTime

      private FileTime aTime
    • arcTime

      private FileTime arcTime
    • fullPackSize

      private long fullPackSize
    • fullUnpackSize

      private long fullUnpackSize
    • fileAttr

      private int fileAttr
    • subFlags

      private int subFlags
    • recoverySectors

      private int recoverySectors
  • Constructor Details

  • Method Details

    • isFilenameValid

      private static boolean isFilenameValid(String filename)
    • parseExtTime

      private static FileHeader.TimePositionTuple parseExtTime(int shift, short flags, byte[] fileHeader, int position)
    • parseExtTime

      private static FileHeader.TimePositionTuple parseExtTime(int shift, short flags, byte[] fileHeader, int position, FileTime baseTime)
    • print

      public void print()
      Overrides:
      print in class BlockHeader
    • getDateDos

      private static long getDateDos(int time)
    • toDate

      private static Date toDate(FileTime time)
    • toFileTime

      private static FileTime toFileTime(Date time)
    • getArchivalTime

      public FileTime getArchivalTime()
      The time in which the file was archived. Corresponds to te arcTime field.
      Returns:
      the timestamp, or null if absent.
    • setArchivalTime

      public void setArchivalTime(FileTime archivalTime)
      Sets the time in which the file was archived. Corresponds to te arcTime field.
      Parameters:
      archivalTime - the timestamp, or null to clear it.
    • getArcTime

      public Date getArcTime()
      Gets getArchivalTime() as a Date. The maximum granularity is reduced from microseconds to milliseconds.
      Returns:
      the date, or null if absent.
    • setArcTime

      public void setArcTime(Date arcTime)
      Parameters:
      arcTime - the date, or null to clear it.
    • getLastAccessTime

      public FileTime getLastAccessTime()
      The time in which the file was last accessed. Corresponds to te aTime field.
      Returns:
      the timestamp, or null if absent.
    • setLastAccessTime

      public void setLastAccessTime(FileTime time)
      Sets the time in which the file was last accessed. Corresponds to te aTime field.
      Parameters:
      time - the timestamp, or null to clear it.
    • getATime

      public Date getATime()
      Gets getLastAccessTime() as a Date. The maximum granularity is reduced from microseconds to milliseconds.
      Returns:
      the date, or null if absent.
    • setATime

      public void setATime(Date time)
      Parameters:
      time - the date, or null to clear it.
    • getCreationTime

      public FileTime getCreationTime()
      The time in which the file was created. Corresponds to te cTime field.
      Returns:
      the timestamp, or null if absent.
    • setCreationTime

      public void setCreationTime(FileTime time)
      Sets the time in which the file was created. Corresponds to te cTime field.
      Parameters:
      time - the timestamp, or null to clear it.
    • getCTime

      public Date getCTime()
      Gets getCreationTime() as a Date. The maximum granularity is reduced from microseconds to milliseconds.
      Returns:
      the date, or null if absent.
    • setCTime

      public void setCTime(Date time)
      Parameters:
      time - the date, or null to clear it.
    • getFileAttr

      public int getFileAttr()
    • setFileAttr

      public void setFileAttr(int fileAttr)
    • getFileCRC

      public int getFileCRC()
    • getFileNameByteArray

      public byte[] getFileNameByteArray()
    • getFileNameString

      @Deprecated public String getFileNameString()
      Deprecated.
      As of 7.2.0, replaced by getFileName()
      The ASCII filename.
      Returns:
      the ASCII filename
    • setFileName

      public void setFileName(String fileName)
    • getFileNameW

      @Deprecated public String getFileNameW()
      Deprecated.
      As of 7.2.0, replaced by getFileName()
      The unicode filename.
      Returns:
      the Unicode filename, or null if the filename is ASCII only
    • setFileNameW

      public void setFileNameW(String fileNameW)
    • getHighPackSize

      public int getHighPackSize()
    • getHighUnpackSize

      public int getHighUnpackSize()
    • getHostOS

      public HostSystem getHostOS()
    • getLastModifiedTime

      public FileTime getLastModifiedTime()
      The time in which the file was last modified. Corresponds to te mTime field.
      Returns:
      the timestamp, or null if absent.
    • setLastModifiedTime

      public void setLastModifiedTime(FileTime time)
      Sets the time in which the file was last modified. Corresponds to te mTime field.
      Parameters:
      time - the timestamp, or null to clear it.
    • getMTime

      public Date getMTime()
      Gets getLastModifiedTime() as a Date. The maximum granularity is reduced from microseconds to milliseconds.
      Returns:
      the date, or null if absent.
    • setMTime

      public void setMTime(Date time)
      Parameters:
      time - the date, or null to clear it.
    • getNameSize

      public short getNameSize()
    • getRecoverySectors

      public int getRecoverySectors()
    • getSalt

      public byte[] getSalt()
    • getSubData

      public byte[] getSubData()
    • getSubFlags

      public int getSubFlags()
    • getUnpMethod

      public byte getUnpMethod()
    • getUnpSize

      public long getUnpSize()
    • getUnpVersion

      public byte getUnpVersion()
    • getFullPackSize

      public long getFullPackSize()
    • getFullUnpackSize

      public long getFullUnpackSize()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isSplitAfter

      public boolean isSplitAfter()
      the file will be continued in the next archive part
      Returns:
      isSplitAfter
    • isSplitBefore

      public boolean isSplitBefore()
      the file is continued in this archive
      Returns:
      isSplitBefore
    • isSolid

      public boolean isSolid()
      this file is compressed as solid (all files handeled as one)
      Returns:
      isSolid
    • isEncrypted

      public boolean isEncrypted()
      the file is encrypted
      Returns:
      isEncrypted
    • isUnicode

      public boolean isUnicode()
      the filename is also present in unicode
      Returns:
      isUnicode
    • isFileHeader

      public boolean isFileHeader()
    • hasSalt

      public boolean hasSalt()
    • hasExtTime

      public boolean hasExtTime()
    • isLargeBlock

      public boolean isLargeBlock()
    • isDirectory

      public boolean isDirectory()
      whether this fileheader represents a directory
      Returns:
      isDirectory
    • getFileName

      public String getFileName()
      The filename either in Unicode or ASCII.
      Returns:
      the Unicode filename if it exists, else the ASCII filename
      Since:
      7.2.0