From ae85bc8810eeff65bc8876645b1c6c3f89982d55 Mon Sep 17 00:00:00 2001 From: Rob Greene Date: Thu, 10 Mar 2022 21:42:43 -0600 Subject: [PATCH] Updating error message to hopefully clarify when the master directory ran out of file entries instead of having an actual full disk. #72 --- .../storage/os/prodos/ProdosFormatDisk.java | 16 ++++++++++++---- .../storage/StorageBundle.properties | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFormatDisk.java b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFormatDisk.java index 7a091c0..873e7b2 100644 --- a/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFormatDisk.java +++ b/lib/ac-api/src/main/java/com/webcodepro/applecommander/storage/os/prodos/ProdosFormatDisk.java @@ -253,7 +253,11 @@ public class ProdosFormatDisk extends FormattedDisk { } blockNumber = nextBlockNumber; } - throw new DiskFullException(textBundle.get("ProdosFormatDisk.UnableToAllocateSpaceError"), this.getFilename()); //$NON-NLS-1$ + if (directory instanceof ProdosSubdirectoryHeader) { + throw new DiskFullException(textBundle.get("ProdosFormatDisk.UnableToAllocateSpaceError"), this.getFilename()); //$NON-NLS-1$ + } else { + throw new DiskFullException(textBundle.get("ProdosFormatDisk.UnableToAllocateFileEntry"), this.getFilename()); + } } /** @@ -1438,8 +1442,12 @@ public class ProdosFormatDisk extends FormattedDisk { } blockNumber = nextBlockNumber; } - throw new DiskFullException( - textBundle.get("ProdosFormatDisk.UnableToAllocateSpaceError") //$NON-NLS-1$ - , this.getFilename()); + if (directory instanceof ProdosSubdirectoryHeader) { + throw new DiskFullException( + textBundle.get("ProdosFormatDisk.UnableToAllocateSpaceError") //$NON-NLS-1$ + , this.getFilename()); + } else { + throw new DiskFullException(textBundle.get("ProdosFormatDisk.UnableToAllocateFileEntry"), this.getFilename()); + } } } diff --git a/lib/ac-api/src/main/resources/com/webcodepro/applecommander/storage/StorageBundle.properties b/lib/ac-api/src/main/resources/com/webcodepro/applecommander/storage/StorageBundle.properties index c6e2605..04b730b 100644 --- a/lib/ac-api/src/main/resources/com/webcodepro/applecommander/storage/StorageBundle.properties +++ b/lib/ac-api/src/main/resources/com/webcodepro/applecommander/storage/StorageBundle.properties @@ -85,6 +85,7 @@ RdosFileEntry.NotInUse= ProdosFormatDisk.InvalidDimensionError=Invalid dimension for isFree\! Did you call next first? ProdosFormatDisk.Blank=BLANK ProdosFormatDisk.UnableToAllocateSpaceError=Unable to allocate more space for another file\! +ProdosFormatDisk.UnableToAllocateFileEntry=Unable to allocate another file entry in root directory\! ProdosFormatDisk.VolumeAccess=Volume Access ProdosFormatDisk.BitmapBlockNumber=Block Number of Bitmap ProdosFormatDisk.CreationDate=Creation Date