Class PascalFileEntry
java.lang.Object
com.webcodepro.applecommander.storage.os.pascal.PascalFileEntry
- All Implemented Interfaces:
FileEntry
Represents a Pascal file entry on disk.
Date created: Oct 5, 2002 12:22:34 AM
-
Constructor Summary
ConstructorsConstructorDescriptionPascalFileEntry(byte[] fileEntry, int index, PascalFormatDisk disk) Constructor for PascalFileEntry. -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Delete the file.intGet the address that this file loads at.intCompute the blocks used.intGet the number of bytes used in files last block.getFileColumnData(int displayMode) Get the standard file column header information.byte[]Get file data.Return the name of this file.getFiles()Retrieve the list of files in this directory.Return the filetype of this file.intGet the block number of the file's 1st block.Get the FormattedDisk associated with this FileEntry.intGet the block number of the file's last block + 1.intReturn the maximum filename length.Get the file modification date.intgetSize()Compute the size of this file (in bytes).Get the suggested FileFilter.booleanPascal file entries are removed upon deletion, so a file entry need not be marked as deleted.booleanPascal does not support directories.booleanisLocked()Identify if this file is lockedbooleanIndicates if this filetype requires an address component.voidsetAddress(int address) Set the address that this file loads at.voidsetBytesUsedInLastBlock(int value) Set the number of bytes used in files last block.voidsetFileCount(int count) Set the file count in a volume entry.voidsetFileData(byte[] data) Set file data for this file entry.voidsetFilename(String filename) Set the name of this file.voidsetFiletype(String filetype) Set the filetype.voidsetFirstBlock(int first) Set the block number of the file's 1st block.voidsetLastBlock(int last) Set the block number of the file's last block + 1.voidsetLocked(boolean lock) Set the lock indicator.voidsetModificationDate(Date date) Set the file modification date.byte[]toBytes()Get the byte[] associated with this FileEntry.protected voidWrite the fileEntry data to the disk image.
-
Constructor Details
-
PascalFileEntry
Constructor for PascalFileEntry.
-
-
Method Details
-
writeFileEntry
protected void writeFileEntry()Write the fileEntry data to the disk image. -
getFirstBlock
public int getFirstBlock()Get the block number of the file's 1st block. -
setFirstBlock
public void setFirstBlock(int first) Set the block number of the file's 1st block. -
getLastBlock
public int getLastBlock()Get the block number of the file's last block + 1. -
setLastBlock
public void setLastBlock(int last) Set the block number of the file's last block + 1. -
getFilename
Return the name of this file.- Specified by:
getFilenamein interfaceFileEntry
-
setFilename
Set the name of this file.- Specified by:
setFilenamein interfaceFileEntry
-
getMaximumFilenameLength
public int getMaximumFilenameLength()Return the maximum filename length.- Specified by:
getMaximumFilenameLengthin interfaceFileEntry
-
getFiletype
Return the filetype of this file.- Specified by:
getFiletypein interfaceFileEntry
-
setFiletype
Set the filetype.- Specified by:
setFiletypein interfaceFileEntry
-
isLocked
public boolean isLocked()Identify if this file is locked -
setLocked
public void setLocked(boolean lock) Set the lock indicator. -
getBytesUsedInLastBlock
public int getBytesUsedInLastBlock()Get the number of bytes used in files last block. -
setBytesUsedInLastBlock
public void setBytesUsedInLastBlock(int value) Set the number of bytes used in files last block. -
getSize
public int getSize()Compute the size of this file (in bytes). -
getBlocksUsed
public int getBlocksUsed()Compute the blocks used. -
isDirectory
public boolean isDirectory()Pascal does not support directories.- Specified by:
isDirectoryin interfaceFileEntry
-
getFiles
Retrieve the list of files in this directory. Always returns null, as Pascal does not support directories. -
isDeleted
public boolean isDeleted()Pascal file entries are removed upon deletion, so a file entry need not be marked as deleted. But the GUI still has a copy of the file list in memory, so we mark it deleted in delete(). -
delete
public void delete()Delete the file. -
getModificationDate
Get the file modification date. -
setModificationDate
Set the file modification date. -
getFileColumnData
Get the standard file column header information. This default implementation is intended only for standard mode. displayMode is specified in FormattedDisk.- Specified by:
getFileColumnDatain interfaceFileEntry
-
getFileData
public byte[] getFileData()Get file data. This handles any operating-system specific issues. Currently, the disk itself handles this.- Specified by:
getFileDatain interfaceFileEntry
-
setFileData
Set file data for this file entry. Because the directory entry may have been changed, use this.index to determine which entry to update. author John B. Matthews.- Specified by:
setFileDatain interfaceFileEntry- Throws:
DiskFullException- See Also:
-
getSuggestedFilter
Get the suggested FileFilter. This appears to be operating system specific, so each operating system needs to implement some manner of guessing the appropriate filter.- Specified by:
getSuggestedFilterin interfaceFileEntry
-
getFormattedDisk
Get the FormattedDisk associated with this FileEntry. This is useful to interfaces that need to retrieve the associated disk.- Specified by:
getFormattedDiskin interfaceFileEntry
-
toBytes
public byte[] toBytes()Get the byte[] associated with this FileEntry. This is need to manipulate the directory as a whole. -
needsAddress
public boolean needsAddress()Indicates if this filetype requires an address component. Note that the FormattedDisk also has this method - normally, this will defer to the method on FormattedDisk, as it will be more generic.- Specified by:
needsAddressin interfaceFileEntry
-
setAddress
public void setAddress(int address) Set the address that this file loads at.- Specified by:
setAddressin interfaceFileEntry
-
getAddress
public int getAddress()Get the address that this file loads at.- Specified by:
getAddressin interfaceFileEntry
-
setFileCount
public void setFileCount(int count) Set the file count in a volume entry. Use only on the volume entry: dir.get(0). author John B. Matthews
-