Package com.webcodepro.shrinkit
Class HeaderBlock
- java.lang.Object
-
- com.webcodepro.shrinkit.HeaderBlock
-
public class HeaderBlock extends java.lang.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:
- Apple II File Type Note $E0/$8002
-
-
Constructor Summary
Constructors Constructor Description HeaderBlock(LittleEndianByteInputStream bs)
Create the Header Block.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ThreadRecord
findThreadRecord(ThreadKind tk)
Locate a ThreadRecord by it's ThreadKind.long
getAccess()
java.util.Date
getArchiveWhen()
byte[]
getAttribBytes()
int
getAttribCount()
long
getCompressedSize()
java.util.Date
getCreateWhen()
ThreadRecord
getDataForkThreadRecord()
Get the data fork.long
getExtraType()
java.lang.String
getFilename()
Locate the filename and return it.int
getFileSysId()
int
getFileSysInfo()
java.lang.String
getFileSystemSeparator()
Helper method to determine the file system separator.long
getFileType()
java.lang.String
getFinalFilename()
Final element in the path, in those cases where a filename actually holds a path nameint
getHeaderCrc()
long
getHeaderSize()
java.util.Date
getModWhen()
byte[]
getOptionListBytes()
int
getOptionSize()
java.lang.String
getRawFilename()
ThreadRecord
getResourceForkThreadRecord()
Get the resource fork.int
getStorageType()
java.util.List<ThreadRecord>
getThreadRecords()
long
getTotalThreads()
long
getUncompressedSize()
int
getVersionNumber()
void
readThreads(LittleEndianByteInputStream bs)
Read in all data threads.void
setAccess(long access)
void
setArchiveWhen(java.util.Date archiveWhen)
void
setAttribBytes(byte[] attribBytes)
void
setAttribCount(int attribCount)
void
setCreateWhen(java.util.Date createWhen)
void
setExtraType(long extraType)
void
setFilename(java.lang.String filename)
void
setFileSysId(int fileSysId)
void
setFileSysInfo(int fileSysInfo)
void
setFileType(long fileType)
void
setHeaderCrc(int headerCrc)
void
setModWhen(java.util.Date modWhen)
void
setOptionListBytes(byte[] optionListBytes)
void
setOptionSize(int optionSize)
void
setStorageType(int storageType)
void
setThreadRecords(java.util.List<ThreadRecord> threads)
void
setTotalThreads(long totalThreads)
void
setVersionNumber(int versionNumber)
-
-
-
Constructor Detail
-
HeaderBlock
public HeaderBlock(LittleEndianByteInputStream bs) throws java.io.IOException
Create the Header Block. This is done dynamically since the Header Block size varies significantly.- Throws:
java.io.IOException
-
-
Method Detail
-
readThreads
public void readThreads(LittleEndianByteInputStream bs) throws java.io.IOException
Read in all data threads. All ThreadRecords are read and then each thread's data is read (per NuFX spec).- Throws:
java.io.IOException
-
getFilename
public java.lang.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 java.lang.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 java.lang.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 java.util.Date getCreateWhen()
-
setCreateWhen
public void setCreateWhen(java.util.Date createWhen)
-
getModWhen
public java.util.Date getModWhen()
-
setModWhen
public void setModWhen(java.util.Date modWhen)
-
getArchiveWhen
public java.util.Date getArchiveWhen()
-
setArchiveWhen
public void setArchiveWhen(java.util.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(java.lang.String filename)
-
getRawFilename
public java.lang.String getRawFilename()
-
getThreadRecords
public java.util.List<ThreadRecord> getThreadRecords()
-
setThreadRecords
public void setThreadRecords(java.util.List<ThreadRecord> threads)
-
getHeaderSize
public long getHeaderSize()
-
-