|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webcodepro.applecommander.storage.os.cpm.CpmFileEntry
public class CpmFileEntry
Support the CP/M file entry. Note that this may actually contain references to multiple file entries via the extent counter.
Field Summary | |
---|---|
static int |
ALL_RECORDS_FILLED_SIZE
The number of bytes used if all records in an extent are filled. |
static int |
ALLOCATION_OFFSET
Beginning of block allocations. |
static int |
ENTRY_LENGTH
The standard CP/M file entry length. |
static int |
EXTENT_COUNTER_OFFSET
Offset to the extent counter (EX) field. |
static int |
FILENAME_LENGTH
Filename length (excluding extension). |
static int |
FILENAME_OFFSET
Offset to beginning of the filename. |
static int |
FILETYPE_LENGTH
Filetype length. |
static int |
FILETYPE_OFFSET
Offset to beginning of the filetype. |
static int |
FILETYPE_T1_OFFSET
Offset to the filetype "T1" entry. |
static int |
FILETYPE_T2_OFFSET
Offset to the filetype "T2" entry. |
static int |
FILETYPE_T3_OFFSET
Offset to the filetype "T3" entry. |
static int |
MAX_EXTENTS_PER_ENTRY
The maximum number of extents per file entry record. |
static int |
RECORD_COUNT_OFFSET
Offset to the record count (RC) field. |
static java.lang.String[] |
TEXT_FILETYPES
A short collection of known text-type files. |
static int |
USER_NUMBER_OFFSET
The user number (UU) field is to distinguish multiple files with the same filename. |
Constructor Summary | |
---|---|
CpmFileEntry(CpmFormatDisk disk,
int offset)
Construct a CP/M file entry. |
Method Summary | |
---|---|
void |
addOffset(int offset)
Add another directory offset to this file entry. |
boolean |
canCompile()
Indicates that this filetype can be compiled. |
void |
delete()
There appears to be no disk map involved, so deleting a file consists of writing a 0xe5 to the user number. |
protected int |
findLargestExtent()
Locate the largest extent for this file. |
int[] |
getAllocations()
Answer with a list of blocks allocated to this file. |
int |
getBlocksUsed()
Compute the number of blocks used. |
int |
getExtentCounterLow(int entryNumber)
Read the extent number, low byte. |
java.util.List |
getFileColumnData(int displayMode)
Get the standard file column header information. |
byte[] |
getFileData()
Get file data. |
java.lang.String |
getFilename()
Answer with the name of the file. |
java.lang.String |
getFiletype()
Answer with the filetype. |
byte |
getFileTypeT1(int entryNumber)
Read the file type T1 entry. |
byte |
getFileTypeT2(int entryNumber)
Read the file type T2 entry. |
byte |
getFileTypeT3(int entryNumber)
Read the file type T3 entry. |
FormattedDisk |
getFormattedDisk()
Answer with the formatted disk. |
int |
getMaximumFilenameLength()
Answer with the maximum filename length. |
int |
getNumberOfRecordsUsed(int entryNumber)
Return the number of records used in this extent, low byte. |
int |
getSize()
Compute the size of this file (in bytes). |
FileFilter |
getSuggestedFilter()
Get the suggested FileFilter. |
int |
getUserNumber(int entryNumber)
Return the user number (UU). |
boolean |
isDeleted()
Indicates if this fileEntry is a deleted file. |
boolean |
isDirectory()
Apple CP/M does not support directories. |
boolean |
isEmpty()
Indicates if this is an empty file entry. |
boolean |
isLocked()
Indicates if this file is locked. |
boolean |
needsAddress()
Indicates if this filetype requires an address component. |
protected byte[] |
readFileEntry(int number)
Read the fileEntry bytes from the disk image. |
void |
setAddress(int address)
Set the address that this file loads at. |
void |
setFileData(byte[] data)
Set file data. |
void |
setFilename(java.lang.String filename)
Set the filename. |
void |
setFiletype(java.lang.String filetype)
Set the filetype. |
void |
setFileTypeT1(int entryNumber,
int t1)
Write the file type T1 entry. |
void |
setFileTypeT2(int entryNumber,
int t2)
Write the file type T2 entry. |
void |
setFileTypeT3(int entryNumber,
int t3)
Write the file type T3 entry. |
void |
setLocked(boolean lock)
Set the locked status. |
void |
setUserNumber(int entryNumber,
int userNumber)
Write the user number (UU). |
protected void |
writeFileEntry(int number,
byte[] data)
Write the fileEntry bytes back to the disk image. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ENTRY_LENGTH
public static final int MAX_EXTENTS_PER_ENTRY
public static final int ALL_RECORDS_FILLED_SIZE
public static final int USER_NUMBER_OFFSET
public static final int FILENAME_OFFSET
public static final int FILENAME_LENGTH
public static final int FILETYPE_OFFSET
public static final int FILETYPE_LENGTH
public static final int FILETYPE_T1_OFFSET
public static final int FILETYPE_T2_OFFSET
public static final int FILETYPE_T3_OFFSET
public static final int EXTENT_COUNTER_OFFSET
public static final int RECORD_COUNT_OFFSET
public static final int ALLOCATION_OFFSET
public static final java.lang.String[] TEXT_FILETYPES
Constructor Detail |
---|
public CpmFileEntry(CpmFormatDisk disk, int offset)
Method Detail |
---|
public void addOffset(int offset)
protected byte[] readFileEntry(int number)
protected void writeFileEntry(int number, byte[] data)
public java.lang.String getFilename()
getFilename
in interface FileEntry
FileEntry.getFilename()
public void setFilename(java.lang.String filename)
setFilename
in interface FileEntry
FileEntry.setFilename(java.lang.String)
public java.lang.String getFiletype()
getFiletype
in interface FileEntry
FileEntry.getFiletype()
public void setFiletype(java.lang.String filetype)
setFiletype
in interface FileEntry
FileEntry.setFiletype(java.lang.String)
public boolean isLocked()
isLocked
in interface FileEntry
FileEntry.isLocked()
public byte getFileTypeT1(int entryNumber)
public void setFileTypeT1(int entryNumber, int t1)
public byte getFileTypeT2(int entryNumber)
public void setFileTypeT2(int entryNumber, int t2)
public byte getFileTypeT3(int entryNumber)
public void setFileTypeT3(int entryNumber, int t3)
public void setLocked(boolean lock)
setLocked
in interface FileEntry
FileEntry.setLocked(boolean)
public int getExtentCounterLow(int entryNumber)
public int getSize()
getSize
in interface FileEntry
FileEntry.getSize()
protected int findLargestExtent()
public int getBlocksUsed()
public int getNumberOfRecordsUsed(int entryNumber)
public boolean isDirectory()
isDirectory
in interface FileEntry
FileEntry.isDirectory()
public boolean isDeleted()
isDeleted
in interface FileEntry
FileEntry.isDeleted()
public int getUserNumber(int entryNumber)
public void setUserNumber(int entryNumber, int userNumber)
public void delete()
delete
in interface FileEntry
FileEntry.delete()
public java.util.List getFileColumnData(int displayMode)
getFileColumnData
in interface FileEntry
public byte[] getFileData()
getFileData
in interface FileEntry
FileEntry.getFileData()
public void setFileData(byte[] data) throws DiskFullException
setFileData
in interface FileEntry
DiskFullException
FileEntry.setFileData(byte[])
public FileFilter getSuggestedFilter()
getSuggestedFilter
in interface FileEntry
FileEntry.getSuggestedFilter()
public FormattedDisk getFormattedDisk()
getFormattedDisk
in interface FileEntry
FileEntry.getFormattedDisk()
public int getMaximumFilenameLength()
getMaximumFilenameLength
in interface FileEntry
FileEntry.getMaximumFilenameLength()
public boolean needsAddress()
needsAddress
in interface FileEntry
FileEntry.needsAddress()
public void setAddress(int address)
setAddress
in interface FileEntry
FileEntry.setAddress(int)
public boolean canCompile()
canCompile
in interface FileEntry
FileEntry.canCompile()
public boolean isEmpty()
public int[] getAllocations()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |