Class RdosFileEntry
- java.lang.Object
-
- com.webcodepro.applecommander.storage.os.rdos.RdosFileEntry
-
- All Implemented Interfaces:
FileEntry
public class RdosFileEntry extends java.lang.Object implements FileEntry
Handle RDOS file entry format.Since I was unable to locate the file entries on the internet, it is documented here: Offset Description
====== ====================================================
$00-$17 File name; space-filled. If the first byte is $00, that is the end of the
directory. If the first byte is $80, the file is deleted.
$18 File type. Appears to be actual letter ('A'=Applesoft, etc)
$19 File length in blocks (block = sector = 256 bytes)
$1A-$1B Address of application. For Applesoft and binary; others may vary.
$1C-$1D Length in bytes of file.
$1E-$1F Starting block of application.
Date created: Oct 7, 2002 1:36:56 PM
-
-
Constructor Summary
Constructors Constructor Description RdosFileEntry(byte[] fileEntry, RdosFormatDisk disk)Constructor for RdosFileEntry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanCompile()Indicates that this filetype can be compiled.voiddelete()Delete the file.intgetAddress()Return the address of application.java.util.List<java.lang.String>getFileColumnData(int displayMode)Get the standard file column header information.byte[]getFileData()Get file data.java.lang.StringgetFilename()Return the name of this file.java.util.List<RdosFileEntry>getFiles()Retrieve the list of files in this directory.java.lang.StringgetFiletype()Return the filetype of this file.FormattedDiskgetFormattedDisk()Get the FormattedDisk associated with this FileEntry.intgetMaximumFilenameLength()Return the maximum filename length.intgetSize()Compute the size of this file (in bytes).intgetSizeInBlocks()Return the number of blocks this file uses.intgetStartingBlock()Return the starting block of this application.FileFiltergetSuggestedFilter()Get the suggested FileFilter.booleanisApplesoftBasicFile()Determine if this is an Applesoft BASIC file.booleanisBinaryFile()Determine if this is a binary file.booleanisDeleted()Identify if this file has been deleted.booleanisDirectory()RDOS does not support directories.booleanisIntegerBasicFile()Determine if this is an Integer BASIC file.booleanisLocked()Locked doesn't appear to be a concept under RDOS.booleanisTextFile()Determine if this is a text file.booleanneedsAddress()Indicates if this filetype requires an address component.voidsetAddress(int address)Set the address that this file loads at.voidsetFileData(byte[] data)Set file data.voidsetFilename(java.lang.String filename)Set the name of this file.voidsetFiletype(java.lang.String filetype)Set the filetype.voidsetLocked(boolean lock)Set the lock indicator.
-
-
-
Constructor Detail
-
RdosFileEntry
public RdosFileEntry(byte[] fileEntry, RdosFormatDisk disk)Constructor for RdosFileEntry.
-
-
Method Detail
-
getSizeInBlocks
public int getSizeInBlocks()
Return the number of blocks this file uses.
-
getStartingBlock
public int getStartingBlock()
Return the starting block of this application.
-
getAddress
public int getAddress()
Return the address of application.- Specified by:
getAddressin interfaceFileEntry
-
getFilename
public java.lang.String getFilename()
Return the name of this file.- Specified by:
getFilenamein interfaceFileEntry
-
setFilename
public void setFilename(java.lang.String filename)
Set the name of this file.- Specified by:
setFilenamein interfaceFileEntry
-
getMaximumFilenameLength
public int getMaximumFilenameLength()
Return the maximum filename length.- Specified by:
getMaximumFilenameLengthin interfaceFileEntry
-
getFiletype
public java.lang.String getFiletype()
Return the filetype of this file.- Specified by:
getFiletypein interfaceFileEntry
-
setFiletype
public void setFiletype(java.lang.String filetype)
Set the filetype.- Specified by:
setFiletypein interfaceFileEntry
-
isLocked
public boolean isLocked()
Locked doesn't appear to be a concept under RDOS.
-
setLocked
public void setLocked(boolean lock)
Set the lock indicator.
-
getSize
public int getSize()
Compute the size of this file (in bytes).
-
isDirectory
public boolean isDirectory()
RDOS does not support directories.- Specified by:
isDirectoryin interfaceFileEntry
-
getFiles
public java.util.List<RdosFileEntry> getFiles()
Retrieve the list of files in this directory. Since RDOS does not support directories, this will always return null.
-
isDeleted
public boolean isDeleted()
Identify if this file has been deleted.
-
getFileColumnData
public java.util.List<java.lang.String> getFileColumnData(int displayMode)
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
public void setFileData(byte[] data) throws DiskFullExceptionSet file data. This, essentially, is saving data to disk using this file entry.- Specified by:
setFileDatain interfaceFileEntry- Throws:
DiskFullException
-
getSuggestedFilter
public FileFilter 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. FIXME - this code should be a helper class for DOS and RDOS!- Specified by:
getSuggestedFilterin interfaceFileEntry
-
isTextFile
public boolean isTextFile()
Determine if this is a text file.
-
isApplesoftBasicFile
public boolean isApplesoftBasicFile()
Determine if this is an Applesoft BASIC file.
-
isIntegerBasicFile
public boolean isIntegerBasicFile()
Determine if this is an Integer BASIC file.
-
isBinaryFile
public boolean isBinaryFile()
Determine if this is a binary file.
-
getFormattedDisk
public FormattedDisk getFormattedDisk()
Get the FormattedDisk associated with this FileEntry. This is useful to interfaces that need to retrieve the associated disk.- Specified by:
getFormattedDiskin interfaceFileEntry
-
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
-
canCompile
public boolean canCompile()
Indicates that this filetype can be compiled. WARNING: RDOS programs most likely will not have the DOS routines handled by the compiler.- Specified by:
canCompilein interfaceFileEntry
-
-