Class PascalFormatDisk
java.lang.Object
com.webcodepro.applecommander.storage.FormattedDisk
com.webcodepro.applecommander.storage.os.pascal.PascalFormatDisk
- All Implemented Interfaces:
DirectoryEntry,Container
Manages a disk that is in the Pascal format.
Date created: Oct 4, 2002 11:56:50 PM
-
Nested Class Summary
Nested classes/interfaces inherited from class com.webcodepro.applecommander.storage.FormattedDisk
FormattedDisk.DiskInformation, FormattedDisk.DiskUsage, FormattedDisk.FileColumnHeader -
Field Summary
FieldsFields inherited from class com.webcodepro.applecommander.storage.FormattedDisk
FILE_DISPLAY_DETAIL, FILE_DISPLAY_NATIVE, FILE_DISPLAY_STANDARD -
Constructor Summary
ConstructorsConstructorDescriptionPascalFormatDisk(String filename, BlockDevice device) Constructor for PascalFormatDisk. -
Method Summary
Modifier and TypeMethodDescriptionbooleanIdentify if additional directories can be created.booleanIndicates if this disk image can create a file.booleanIndicates if this disk image can delete a file.booleanIdentify if this disk format is capable of having directories.booleanIndicates if this disk image can read data from a file.booleanIndicates if this disk image can write data to a file.static PascalFormatDisk[]create(String filename, String volumeName, BlockDevice device) Create a PascalFormatDisk.createDirectory(String name) Create a new DirectoryEntry.Create a new FileEntry.voidformat()Format the disk as an Apple Pascal disk.<T> Optional<T> int[]Get suggested dimensions for display of bitmap.String[]Get the labels to use in the bitmap.intGet the length of the bitmap.intReturn the number of blocks on disk.Retrieve the entire directory.Gives an indication on how this disk's geometry should be handled.Get Pascal-specific disk information.Return the name of the disk.Get the disk usage iterator.getFileColumnHeaders(int displayMode) Get the standard file column header information.byte[]getFileData(FileEntry fileEntry) Get the data associated with the specified FileEntry.getFiles()Retrieve a list of files.intReturn the number of files on disk.String[]Returns a list of possible file types.intReturn the first block.Identify the operating system format of this disk.intReturn the number of free blocks.intReturn the amount of free space in bytes.Return the last access date.intReturns the logical disk number.Return the most recent date setting.getSuggestedFilename(String filename) Returns a valid filename for the given filename.getSuggestedFiletype(String filename) Returns a valid filetype for the given filename.intReturn the number of used blocks.intReturn the amount of used space in bytes.protected byte[]Return the volume entry.booleanneedsAddress(String filetype) Indicates if this filetype requires an address component.voidputDirectory(List<PascalFileEntry> files) Write the revised directory.protected byte[]readBlock(int block) byte[]Read directory blocks.voidsetDiskName(String volumeName) Set the name of the disk.voidsetFileData(FileEntry fileEntry, byte[] fileData) Writes the raw bytes into the file.booleanIndicates if this disk format supports "deleted" files.booleanIndicates if this FormattedDisk supports a disk map.toNativeFiletype(String prodosFiletype) Provides conversation from a given ProDOS file type since as it is common across many archiving tools.toProdosFiletype(String nativeFiletype) Provides conversation to a given ProDOS file type since as it is common across many archiving tools.protected voidwriteBlock(int block, byte[] data) voidwriteDirectory(byte[] directory) Write directory blocks.Methods inherited from class com.webcodepro.applecommander.storage.FormattedDisk
getBootCode, getDirname, getFile, getFile, getFilename, getFormattedDisk, getSource, hasChanged, isNewImage, resizeDiskImage, resizeDiskImage, save, saveAs, setFilename
-
Field Details
-
ENTRY_SIZE
public static final int ENTRY_SIZEThe size of the Pascal file entry.- See Also:
-
-
Constructor Details
-
PascalFormatDisk
Constructor for PascalFormatDisk.
-
-
Method Details
-
create
Create a PascalFormatDisk. -
readBlock
protected byte[] readBlock(int block) -
writeBlock
protected void writeBlock(int block, byte[] data) -
get
-
getFormat
Identify the operating system format of this disk.- Specified by:
getFormatin classFormattedDisk- See Also:
-
getFiles
Retrieve a list of files.- See Also:
-
getDirectory
Retrieve the entire directory. -
putDirectory
Write the revised directory. -
createFile
Create a new FileEntry.- Throws:
DiskFullException
-
canCreateDirectories
public boolean canCreateDirectories()Identify if additional directories can be created. This may indicate that directories are not available to this operating system or simply that the disk image is "locked" to writing. -
canCreateFile
public boolean canCreateFile()Indicates if this disk image can create a file. If not, the reason may be as simple as it has not beem implemented to something specific about the disk. -
readDirectory
public byte[] readDirectory()Read directory blocks. These are always in blocks 2 - 5 and are treated as a 2048 byte array. -
writeDirectory
public void writeDirectory(byte[] directory) Write directory blocks. -
canHaveDirectories
public boolean canHaveDirectories()Identify if this disk format is capable of having directories.- Specified by:
canHaveDirectoriesin classFormattedDisk- See Also:
-
getFreeSpace
public int getFreeSpace()Return the amount of free space in bytes.- Specified by:
getFreeSpacein classFormattedDisk- See Also:
-
getFreeBlocks
public int getFreeBlocks()Return the number of free blocks. -
getVolumeEntry
protected byte[] getVolumeEntry()Return the volume entry. -
getBlocksOnDisk
public int getBlocksOnDisk()Return the number of blocks on disk. -
getFilesOnDisk
public int getFilesOnDisk()Return the number of files on disk. -
getFirstBlock
public int getFirstBlock()Return the first block. -
getLastAccessDate
Return the last access date. -
getMostRecentDateSetting
Return the most recent date setting. Huh? -
getUsedSpace
public int getUsedSpace()Return the amount of used space in bytes.- Specified by:
getUsedSpacein classFormattedDisk- See Also:
-
getUsedBlocks
public int getUsedBlocks()Return the number of used blocks. -
getDiskName
Return the name of the disk. This is stored on block #2 offset +6 (string[7]).- Specified by:
getDiskNamein classFormattedDisk- See Also:
-
setDiskName
Set the name of the disk. The Pascal parlance is "volume name" whereas AppleCommander uses disk name. Max length is 7.- Overrides:
setDiskNamein classFormattedDisk
-
getBitmapDimensions
public int[] getBitmapDimensions()Get suggested dimensions for display of bitmap. Since Pascal disks are a block device, no suggestion is given.- Specified by:
getBitmapDimensionsin classFormattedDisk
-
getBitmapLength
public int getBitmapLength()Get the length of the bitmap.- Specified by:
getBitmapLengthin classFormattedDisk
-
getDiskUsage
Get the disk usage iterator.- Specified by:
getDiskUsagein classFormattedDisk
-
getBitmapLabels
Get the labels to use in the bitmap.- Specified by:
getBitmapLabelsin classFormattedDisk
-
getDiskInformation
Get Pascal-specific disk information.- Overrides:
getDiskInformationin classFormattedDisk
-
getFileColumnHeaders
Get the standard file column header information. This default implementation is intended only for standard mode.- Overrides:
getFileColumnHeadersin classFormattedDisk
-
supportsDeletedFiles
public boolean supportsDeletedFiles()Indicates if this disk format supports "deleted" files.- Specified by:
supportsDeletedFilesin classFormattedDisk
-
canReadFileData
public boolean canReadFileData()Indicates if this disk image can read data from a file.- Specified by:
canReadFileDatain classFormattedDisk
-
canWriteFileData
public boolean canWriteFileData()Indicates if this disk image can write data to a file.- Specified by:
canWriteFileDatain classFormattedDisk
-
canDeleteFile
public boolean canDeleteFile()Indicates if this disk image can delete a file.- Specified by:
canDeleteFilein classFormattedDisk
-
getFileData
Get the data associated with the specified FileEntry.- Specified by:
getFileDatain classFormattedDisk- See Also:
-
format
public void format()Format the disk as an Apple Pascal disk.- Specified by:
formatin classFormattedDisk- See Also:
-
getLogicalDiskNumber
public int getLogicalDiskNumber()Returns the logical disk number. Returns a 0 to indicate no numbering.- Specified by:
getLogicalDiskNumberin classFormattedDisk
-
getSuggestedFilename
Returns a valid filename for the given filename. Summary taken from the filename description in "Apple Pascal: Operating System Reference Manual." A legal diskette filename can consist of up to 15 characters. Lower- case letters typed into a filename are translated to upper-case, and spaces and non-printing characters are removed from the filename. All characters are legal in filenames. However, from the keyboard you should not type filenames that include the following characters: dollar sign ($), left square bracket ([), equals sign (=) question mark, (?), RETURN, and the CTRL characters C, F, M, S, U, and @. WARNING: The Filer will not be able to access filenames containing the characters dollar sign ($), equals sign (=), question mark (?), or comma (,)- Specified by:
getSuggestedFilenamein classFormattedDisk
-
getSuggestedFiletype
Returns a valid filetype for the given filename. The most simple format will just assume a filetype of binary. This method is available for the interface to make an intelligent first guess as to the filetype.- Specified by:
getSuggestedFiletypein classFormattedDisk
-
getFiletypes
Returns a list of possible file types. Since the filetype is specific to each operating system, a simple String is used.- Specified by:
getFiletypesin classFormattedDisk
-
needsAddress
Indicates if this filetype requires an address component. No Pascal filetypes require or support an address.- Specified by:
needsAddressin classFormattedDisk
-
supportsDiskMap
public boolean supportsDiskMap()Indicates if this FormattedDisk supports a disk map.- Overrides:
supportsDiskMapin classFormattedDisk
-
setFileData
Writes the raw bytes into the file. This bypasses any special formatting of the data (such as prepending the data with a length and/or an address). Typically, the FileEntry.setFileData method should be used.- Specified by:
setFileDatain classFormattedDisk
-
createDirectory
Create a new DirectoryEntry.- See Also:
-
getDiskGeometry
Gives an indication on how this disk's geometry should be handled.- Specified by:
getDiskGeometryin classFormattedDisk
-
toNativeFiletype
Provides conversation from a given ProDOS file type since as it is common across many archiving tools.- Specified by:
toNativeFiletypein classFormattedDisk
-
toProdosFiletype
Provides conversation to a given ProDOS file type since as it is common across many archiving tools.- Specified by:
toProdosFiletypein classFormattedDisk
-