Class DosFileEntry
- java.lang.Object
-
- com.webcodepro.applecommander.storage.os.dos33.DosFileEntry
-
-
Field Summary
Fields Modifier and Type Field Description static intFILE_DESCRIPTIVE_ENTRY_LENGTHIndicates the length in bytes of the DOS file entry field.
-
Constructor Summary
Constructors Constructor Description DosFileEntry(DosFormatDisk disk, int track, int sector, int offset)Constructor for DosFileEntry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanCompile()Indicates that this filetype can be compiled.voiddelete()Delete this file.intgetAddress()Get the address that this file loads at.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.lang.StringgetFiletype()Return the filetype of this file.FormattedDiskgetFormattedDisk()Get the FormattedDisk associated with this FileEntry.intgetMaximumFilenameLength()Return the maximum filename length.intgetSector()Get the sector of first track/sector list sector.intgetSectorsUsed()Compute the number of sectors used.intgetSize()Compute the size of this file (in bytes).FileFiltergetSuggestedFilter()Get the suggested FileFilter.intgetTrack()Get the track of first track/sector list sector.booleanisApplesoftBasicFile()Determine if this is an Applesoft BASIC file.booleanisAssemblySourceFile()Determine if this is an assembly source code file.booleanisBinaryFile()Determine if this is a binary file.booleanisDeleted()Identify if this file has been deleted.booleanisDirectory()Identify if this is a directory file.booleanisIntegerBasicFile()Determine if this is an Integer BASIC file.booleanisLocked()Identify if this file is locked.booleanisTextFile()Determine if this is a text file.booleanneedsAddress()Indicates if this filetype requires an address component.protected byte[]readFileEntry()Read the FileEntry from the disk image.voidsetAddress(int address)Set the address that this file loads at.voidsetFileData(byte[] data)Set the 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.voidsetSector(int sector)Set the sector of the first track/sector list sector.voidsetSectorsUsed(int sectorsUsed)Set the number of sectors used.voidsetTrack(int track)Set the track of the first track/sector list sector.protected voidwriteFileEntry(byte[] fileEntry)Write the FileEntry to the disk image.
-
-
-
Field Detail
-
FILE_DESCRIPTIVE_ENTRY_LENGTH
public static final int FILE_DESCRIPTIVE_ENTRY_LENGTH
Indicates the length in bytes of the DOS file entry field.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DosFileEntry
public DosFileEntry(DosFormatDisk disk, int track, int sector, int offset)
Constructor for DosFileEntry.
-
-
Method Detail
-
readFileEntry
protected byte[] readFileEntry()
Read the FileEntry from the disk image.
-
writeFileEntry
protected void writeFileEntry(byte[] fileEntry)
Write the FileEntry to the disk image.
-
getMaximumFilenameLength
public int getMaximumFilenameLength()
Return the maximum filename length.- Specified by:
getMaximumFilenameLengthin interfaceFileEntry
-
getFilename
public java.lang.String getFilename()
Return the name of this file.- Specified by:
getFilenamein interfaceFileEntry- See Also:
FileEntry.getFilename()
-
setFilename
public void setFilename(java.lang.String filename)
Set the name of this file.- Specified by:
setFilenamein interfaceFileEntry
-
getFiletype
public java.lang.String getFiletype()
Return the filetype of this file.- Specified by:
getFiletypein interfaceFileEntry- See Also:
FileEntry.getFiletype()
-
setFiletype
public void setFiletype(java.lang.String filetype)
Set the filetype. This contains some ProDOS file type translation to support translation from an AppleSingle archive.- Specified by:
setFiletypein interfaceFileEntry
-
isLocked
public boolean isLocked()
Identify if this file is locked.- Specified by:
isLockedin interfaceFileEntry- See Also:
FileEntry.isLocked()
-
setLocked
public void setLocked(boolean lock)
Set the lock indicator.
-
getSize
public int getSize()
Compute the size of this file (in bytes).- Specified by:
getSizein interfaceFileEntry- See Also:
FileEntry.getSize()
-
getSectorsUsed
public int getSectorsUsed()
Compute the number of sectors used.
-
setSectorsUsed
public void setSectorsUsed(int sectorsUsed)
Set the number of sectors used.
-
isDirectory
public boolean isDirectory()
Identify if this is a directory file.- Specified by:
isDirectoryin interfaceFileEntry- See Also:
FileEntry.isDirectory()
-
isDeleted
public boolean isDeleted()
Identify if this file has been deleted.- Specified by:
isDeletedin interfaceFileEntry- See Also:
FileEntry.isDeleted()
-
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
-
getTrack
public int getTrack()
Get the track of first track/sector list sector.
-
setTrack
public void setTrack(int track)
Set the track of the first track/sector list sector.
-
getSector
public int getSector()
Get the sector of first track/sector list sector.
-
setSector
public void setSector(int sector)
Set the sector of the first track/sector list sector.
-
getFileData
public byte[] getFileData()
Get file data. This handles any operating-system specific issues. Specifically, DOS 3.3 places address and length into binary files and length into Applesoft files.- Specified by:
getFileDatain interfaceFileEntry
-
setFileData
public void setFileData(byte[] data) throws DiskFullExceptionSet the file data. This is essentially the save operation. Specifically, if the filetype is binary, the length and address need to be set. If the filetype is applesoft or integer basic, the start address needs to be set. Note: The address can be set before the data is saved or after the data is saved. This is an attempt to make the API more easily usable. Empirically, the data must be set before the address is set.- 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
-
isAssemblySourceFile
public boolean isAssemblySourceFile()
Determine if this is an assembly source code file.
-
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
-
getAddress
public int getAddress()
Get the address that this file loads at.- Specified by:
getAddressin interfaceFileEntry
-
canCompile
public boolean canCompile()
Indicates that this filetype can be compiled.- Specified by:
canCompilein interfaceFileEntry
-
-