Package com.webcodepro.shrinkit
Class HeaderBlock
java.lang.Object
com.webcodepro.shrinkit.HeaderBlock
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ThreadRecordLocate a ThreadRecord by it's ThreadKind.longbyte[]intlongGet the data fork.longLocate the filename and return it.intintHelper method to determine the file system separator.longFinal element in the path, in those cases where a filename actually holds a path nameintlongbyte[]intGet the resource fork.intlonglongintvoidRead in all data threads.voidsetAccess(long access) voidsetArchiveWhen(Date archiveWhen) voidsetAttribBytes(byte[] attribBytes) voidsetAttribCount(int attribCount) voidsetCreateWhen(Date createWhen) voidsetExtraType(long extraType) voidsetFilename(String filename) voidsetFileSysId(int fileSysId) voidsetFileSysInfo(int fileSysInfo) voidsetFileType(long fileType) voidsetHeaderCrc(int headerCrc) voidsetModWhen(Date modWhen) voidsetOptionListBytes(byte[] optionListBytes) voidsetOptionSize(int optionSize) voidsetStorageType(int storageType) voidsetThreadRecords(List<ThreadRecord> threads) voidsetTotalThreads(long totalThreads) voidsetVersionNumber(int versionNumber)
-
Constructor Details
-
HeaderBlock
Create the Header Block. This is done dynamically since the Header Block size varies significantly.- Throws:
IOException
-
-
Method Details
-
readThreads
Read in all data threads. All ThreadRecords are read and then each thread's data is read (per NuFX spec).- Throws:
IOException
-
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
Final element in the path, in those cases where a filename actually holds a path name -
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
Get the resource fork. -
findThreadRecord
Locate a ThreadRecord by it's ThreadKind. -
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
-
setCreateWhen
-
getModWhen
-
setModWhen
-
getArchiveWhen
-
setArchiveWhen
-
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
-
getRawFilename
-
getThreadRecords
-
setThreadRecords
-
getHeaderSize
public long getHeaderSize()
-