From d6867f61db33204f503a9b6c10e5c0c628486616 Mon Sep 17 00:00:00 2001 From: Robert Greene Date: Sun, 26 Jan 2003 02:39:39 +0000 Subject: [PATCH] Added getSuggestedFilename and a null createFile (to get rid of error messages; will be implemented later). --- .../storage/PascalFormatDisk.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/com/webcodepro/applecommander/storage/PascalFormatDisk.java b/src/com/webcodepro/applecommander/storage/PascalFormatDisk.java index 637a650..dafb473 100644 --- a/src/com/webcodepro/applecommander/storage/PascalFormatDisk.java +++ b/src/com/webcodepro/applecommander/storage/PascalFormatDisk.java @@ -131,6 +131,14 @@ public class PascalFormatDisk extends FormattedDisk { } return list; } + + /** + * Create a new FileEntry. + */ + public FileEntry createFile() throws DiskFullException { + // FIXME: Need to implement! + return null; + } /** * Read directory blocks. These are always in blocks 2 - 5 and @@ -426,4 +434,25 @@ public class PascalFormatDisk extends FormattedDisk { public int getLogicalDiskNumber() { return 0; } + + /** + * Returns a valid filename for the given filename. This is somewhat + * of a guess, but the Pascal filenames appear to have similar + * restrictions as ProDOS. + */ + public String getSuggestedFilename(String filename) { + StringBuffer newName = new StringBuffer(); + if (!Character.isLetter(filename.charAt(0))) { + newName.append('A'); + } + int i=0; + while (newName.length() < 15 && i