Class PascalDirectory
java.lang.Object
org.applecommander.os.pascal.PascalDirectory
- All Implemented Interfaces:
Directory, WritableDirectory, PascalConstants
-
Field Summary
Fields inherited from interface PascalConstants
BAD, CAPABILITIES, DIRECTORY_BLOCKS, DIRECTORY_FIRST_BLOCK, DIRECTORY_LAST_BLOCK, ENTRY_FIRST_BLOCK, ENTRY_LAST_BLOCK, ENTRY_LENGTH, ENTRY_NAME, ENTRY_TYPE, FILE_BYTES_USED_IN_LAST_BLOCK, FILE_MODIFICATION_DATE, FILE_NAME_LENGTH, FILE_NAME_MAPPER, MAX_DIRECTORY_BYTES, MAX_DIRECTORY_ENTRIES, PCD, PDA, PTX, VOLUME_BLOCKS_ON_DISK, VOLUME_FILES_ON_DISK, VOLUME_NAME_LENGTH, VOLUME_NAME_MAPPER, VOLUME_RECENT_DATE -
Method Summary
Modifier and TypeMethodDescriptioncreateFile(String fileName) Create a file.createFrom(ProdosAttributes prodosAttributes) Create a file given the supplied ProDOS attributes.voiddeleteFile(FileEntry fileEntry) Delete a Pascal file.intgetFiles()Return all entries that are stored in this directory.intReturns the FileStore that this Directory belongs to.getName()Returns the name of this directory.voidmodifyEntry(Consumer<DataBuffer> consumer) voidsetMostRecentDate(Date date) voidSets the name of this directory.voidupdateFilesOnDisk(int modifier) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Directory
findFile, getDirectories, getParentMethods inherited from interface WritableDirectory
createDirectory
-
Method Details
-
readEntry
-
modifyEntry
-
getFileStore
Returns the FileStore that this Directory belongs to.- Specified by:
getFileStorein interfaceDirectory
-
getName
-
setName
Sets the name of this directory. Per the Apple Pascal documentation:
A diskette's volume name must be seven or fewer characters long and may not contain an equals sign (
=), dollar sign ($), question mark (?) or comma(,).This method only errors if, after applying the rules, the string is empty.
-
getBlocksOnDisk
public int getBlocksOnDisk() -
getFilesOnDisk
public int getFilesOnDisk() -
updateFilesOnDisk
public void updateFilesOnDisk(int modifier) -
getMostRecentDate
-
setMostRecentDate
-
getFiles
-
createFile
Create a file. By definition, any file created is aWritableFileEntry.- Specified by:
createFilein interfaceWritableDirectory- See Also:
-
createFrom
Create a file given the supplied ProDOS attributes. This is expected to handle setting all appropriateFileEntryattributes that align. File type should be converted, dates applied, etc.- Specified by:
createFromin interfaceWritableDirectory- See Also:
-
deleteFile
Delete a Pascal file. Pascal does not mark a file as delete, it simply removes the entry. This logic copies all data after into this position. Note that, regardless, any existingPascalFileEntryobjects are invalid since their offset will be incorrect.- Specified by:
deleteFilein interfaceWritableDirectory- See Also:
-