From 70f5149d18205c5de928a618b31b5dcad35e91d3 Mon Sep 17 00:00:00 2001 From: Robert Greene Date: Tue, 21 Jan 2003 05:14:46 +0000 Subject: [PATCH] Added getMaximumFilenameLength. This is used by the ImportWizard to keep names a sensible length. --- .../webcodepro/applecommander/storage/DosFileEntry.java | 7 +++++++ src/com/webcodepro/applecommander/storage/FileEntry.java | 5 +++++ .../webcodepro/applecommander/storage/PascalFileEntry.java | 7 +++++++ .../webcodepro/applecommander/storage/ProdosFileEntry.java | 7 +++++++ .../webcodepro/applecommander/storage/RdosFileEntry.java | 7 +++++++ 5 files changed, 33 insertions(+) diff --git a/src/com/webcodepro/applecommander/storage/DosFileEntry.java b/src/com/webcodepro/applecommander/storage/DosFileEntry.java index 0049a7e..38de396 100644 --- a/src/com/webcodepro/applecommander/storage/DosFileEntry.java +++ b/src/com/webcodepro/applecommander/storage/DosFileEntry.java @@ -86,6 +86,13 @@ public class DosFileEntry implements FileEntry { disk.writeSector(track, sector, sectorData); } + /** + * Return the maximum filename length. + */ + public int getMaximumFilenameLength() { + return 30; + } + /** * Return the name of this file. * @see com.webcodepro.applecommander.storage.FileEntry#getFilename() diff --git a/src/com/webcodepro/applecommander/storage/FileEntry.java b/src/com/webcodepro/applecommander/storage/FileEntry.java index f263b4d..bc93bce 100644 --- a/src/com/webcodepro/applecommander/storage/FileEntry.java +++ b/src/com/webcodepro/applecommander/storage/FileEntry.java @@ -121,4 +121,9 @@ public interface FileEntry { * disk. */ public FormattedDisk getFormattedDisk(); + + /** + * Return the maximum filename length. + */ + public int getMaximumFilenameLength(); } diff --git a/src/com/webcodepro/applecommander/storage/PascalFileEntry.java b/src/com/webcodepro/applecommander/storage/PascalFileEntry.java index 619ab4d..1015af4 100644 --- a/src/com/webcodepro/applecommander/storage/PascalFileEntry.java +++ b/src/com/webcodepro/applecommander/storage/PascalFileEntry.java @@ -64,6 +64,13 @@ public class PascalFileEntry implements FileEntry { public String getFilename() { return AppleUtil.getPascalString(fileEntry, 6); } + + /** + * Return the maximum filename length. + */ + public int getMaximumFilenameLength() { + return 15; + } /** * Return the filetype of this file. diff --git a/src/com/webcodepro/applecommander/storage/ProdosFileEntry.java b/src/com/webcodepro/applecommander/storage/ProdosFileEntry.java index da6a2f7..419318e 100644 --- a/src/com/webcodepro/applecommander/storage/ProdosFileEntry.java +++ b/src/com/webcodepro/applecommander/storage/ProdosFileEntry.java @@ -139,6 +139,13 @@ public class ProdosFileEntry extends ProdosCommonEntry implements FileEntry { return fileName; } + /** + * Return the maximum filename length. + */ + public int getMaximumFilenameLength() { + return 15; + } + /** * Set the name of this file. */ diff --git a/src/com/webcodepro/applecommander/storage/RdosFileEntry.java b/src/com/webcodepro/applecommander/storage/RdosFileEntry.java index 11f09eb..31818f4 100644 --- a/src/com/webcodepro/applecommander/storage/RdosFileEntry.java +++ b/src/com/webcodepro/applecommander/storage/RdosFileEntry.java @@ -82,6 +82,13 @@ public class RdosFileEntry implements FileEntry { public String getFilename() { return isDeleted() ? " " : AppleUtil.getString(fileEntry, 0, 24); } + + /** + * Return the maximum filename length. + */ + public int getMaximumFilenameLength() { + return 24; + } /** * Return the filetype of this file.