Class GutenbergFileEntry
java.lang.Object
com.webcodepro.applecommander.storage.os.gutenberg.GutenbergFileEntry
- All Implemented Interfaces:
FileEntry
Represents a Gutenberg word processing file entry on disk.
Date created: Dec 17, 2008 04:29:23 PM
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Indicates the length in bytes of the DOS file entry field. -
Constructor Summary
ConstructorsConstructorDescriptionGutenbergFileEntry
(GutenbergFormatDisk disk, int track, int sector, int offset) Constructor for GutenbergFileEntry. -
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
Delete this file.int
Get the address that this file loads at.getFileColumnData
(int displayMode) Get the standard file column header information.byte[]
Get file data.Return the name of this file.Return the filetype of this file.Get the FormattedDisk associated with this FileEntry.int
Return the maximum filename length.int
Get the sector of first track/sector list sector.int
Compute the number of sectors used.int
getSize()
Compute the size of this file (in bytes).Get the suggested FileFilter.int
getTrack()
Get the track of first track/sector list sector.boolean
Determine if this is an assembly source code file.boolean
Identify if this file has been deleted.boolean
Identify if this is a directory file.boolean
isLocked()
Identify if this file is locked.boolean
Indicates if this filetype requires an address component.protected byte[]
Read the FileEntry from the disk image.void
setAddress
(int address) Set the address that this file loads at.void
setFileData
(byte[] data) Set the file data.void
setFilename
(String filename) Set the name of this file.void
setFiletype
(String filetype) Set the filetype (typeless - unused)void
setLocked
(boolean lock) Set the lock indicator (unused)void
setSector
(int sector) Set the sector of the first track/sector list sector.void
setSectorsUsed
(int sectorsUsed) Set the number of sectors used.void
setTrack
(int track) Set the track of the first track/sector list sector.protected void
writeFileEntry
(byte[] fileEntry) Write the FileEntry to the disk image.
-
Field Details
-
FILE_DESCRIPTIVE_ENTRY_LENGTH
public static final int FILE_DESCRIPTIVE_ENTRY_LENGTHIndicates the length in bytes of the DOS file entry field.- See Also:
-
-
Constructor Details
-
GutenbergFileEntry
Constructor for GutenbergFileEntry.
-
-
Method Details
-
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:
getMaximumFilenameLength
in interfaceFileEntry
-
getFilename
Return the name of this file.- Specified by:
getFilename
in interfaceFileEntry
- See Also:
-
setFilename
Set the name of this file.- Specified by:
setFilename
in interfaceFileEntry
-
getFiletype
Return the filetype of this file.- Specified by:
getFiletype
in interfaceFileEntry
- See Also:
-
setFiletype
Set the filetype (typeless - unused)- Specified by:
setFiletype
in interfaceFileEntry
-
isLocked
public boolean isLocked()Identify if this file is locked. -
setLocked
public void setLocked(boolean lock) Set the lock indicator (unused) -
getSize
public int getSize()Compute the size of this file (in bytes). -
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:
isDirectory
in interfaceFileEntry
- See Also:
-
isDeleted
public boolean isDeleted()Identify if this file has been deleted. -
delete
public void delete()Delete this file. -
getFileColumnData
Get the standard file column header information. This default implementation is intended only for standard mode. displayMode is specified in FormattedDisk.- Specified by:
getFileColumnData
in 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.- Specified by:
getFileData
in interfaceFileEntry
-
setFileData
Set the file data. 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:
setFileData
in interfaceFileEntry
- Throws:
DiskFullException
-
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:
getSuggestedFilter
in interfaceFileEntry
-
isAssemblySourceFile
public boolean isAssemblySourceFile()Determine if this is an assembly source code file. -
getFormattedDisk
Get the FormattedDisk associated with this FileEntry. This is useful to interfaces that need to retrieve the associated disk.- Specified by:
getFormattedDisk
in 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:
needsAddress
in interfaceFileEntry
-
setAddress
public void setAddress(int address) Set the address that this file loads at.- Specified by:
setAddress
in interfaceFileEntry
-
getAddress
public int getAddress()Get the address that this file loads at.- Specified by:
getAddress
in interfaceFileEntry
-