Class HeaderBlock

java.lang.Object
com.webcodepro.shrinkit.HeaderBlock

public class HeaderBlock extends Object
The Header Block contains information and content about a single entry (be it a file or disk image).

Note that we need to support multiple versions of the NuFX archive format. Some details may be invalid, depending on version, and those are documented in the getter methods.

See Also:
  • Constructor Details

  • Method Details

    • readThreads

      public void readThreads(LittleEndianByteInputStream bs) throws IOException
      Read in all data threads. All ThreadRecords are read and then each thread's data is read (per NuFX spec).
      Throws:
      IOException
    • getFilename

      public String getFilename()
      Locate the filename and return it. It may have been given in the old location, in which case, it is in the String filename. Otherwise it will be in the filename thread. If it is in the thread, we shove it in the filename variable just so we don't need to search for it later. This should not be a problem, because if we write the file, we'll write the more current version anyway.
    • getFinalFilename

      public String getFinalFilename()
      Final element in the path, in those cases where a filename actually holds a path name
    • getDataForkThreadRecord

      public ThreadRecord getDataForkThreadRecord()
      Get the data fork. Note that this first searches the data fork and then searches for a disk image; this may not be correct behavior.
    • getResourceForkThreadRecord

      public ThreadRecord getResourceForkThreadRecord()
      Get the resource fork.
    • findThreadRecord

      protected ThreadRecord findThreadRecord(ThreadKind tk)
      Locate a ThreadRecord by it's ThreadKind.
    • getFileSystemSeparator

      public String getFileSystemSeparator()
      Helper method to determine the file system separator. Due to some oddities, breaking apart by byte value...
    • getUncompressedSize

      public long getUncompressedSize()
    • getCompressedSize

      public long getCompressedSize()
    • getHeaderCrc

      public int getHeaderCrc()
    • setHeaderCrc

      public void setHeaderCrc(int headerCrc)
    • getAttribCount

      public int getAttribCount()
    • setAttribCount

      public void setAttribCount(int attribCount)
    • getVersionNumber

      public int getVersionNumber()
    • setVersionNumber

      public void setVersionNumber(int versionNumber)
    • getTotalThreads

      public long getTotalThreads()
    • setTotalThreads

      public void setTotalThreads(long totalThreads)
    • getFileSysId

      public int getFileSysId()
    • setFileSysId

      public void setFileSysId(int fileSysId)
    • getFileSysInfo

      public int getFileSysInfo()
    • setFileSysInfo

      public void setFileSysInfo(int fileSysInfo)
    • getAccess

      public long getAccess()
    • setAccess

      public void setAccess(long access)
    • getFileType

      public long getFileType()
    • setFileType

      public void setFileType(long fileType)
    • getExtraType

      public long getExtraType()
    • setExtraType

      public void setExtraType(long extraType)
    • getStorageType

      public int getStorageType()
    • setStorageType

      public void setStorageType(int storageType)
    • getCreateWhen

      public Date getCreateWhen()
    • setCreateWhen

      public void setCreateWhen(Date createWhen)
    • getModWhen

      public Date getModWhen()
    • setModWhen

      public void setModWhen(Date modWhen)
    • getArchiveWhen

      public Date getArchiveWhen()
    • setArchiveWhen

      public void setArchiveWhen(Date archiveWhen)
    • getOptionSize

      public int getOptionSize()
    • setOptionSize

      public void setOptionSize(int optionSize)
    • getOptionListBytes

      public byte[] getOptionListBytes()
    • setOptionListBytes

      public void setOptionListBytes(byte[] optionListBytes)
    • getAttribBytes

      public byte[] getAttribBytes()
    • setAttribBytes

      public void setAttribBytes(byte[] attribBytes)
    • setFilename

      public void setFilename(String filename)
    • getRawFilename

      public String getRawFilename()
    • getThreadRecords

      public List<ThreadRecord> getThreadRecords()
    • setThreadRecords

      public void setThreadRecords(List<ThreadRecord> threads)
    • getHeaderSize

      public long getHeaderSize()