Adding pascal area and extended file to known storage types.

This commit is contained in:
Rob Greene 2022-06-26 09:22:25 -05:00
parent 990a92d9df
commit 2a14640eb3
5 changed files with 42 additions and 8 deletions

View File

@ -162,6 +162,35 @@ public class ProdosCommonEntry {
setStorageType(0x03);
}
/**
* Indicates if this is a "pascal area".
*/
public boolean isPascalArea() {
return getStorageType() == 0x04;
}
/**
* Sets the storage type to a "pascal area".
*/
public void setPascalArea() {
setStorageType(0x04);
}
/**
* Indicates if this is an "extended" file (GS/OS with resource and data forks).
*/
public boolean isExtendedFile() {
return getStorageType() == 0x05;
}
/**
* Sets the storage type to an "extended" file (GS/OS with resource and data forks).
*/
public void setExtendedFile() {
setStorageType(0x05);
}
/**
* Indicates if this is a subdirectory entry.
*/

View File

@ -504,10 +504,13 @@ public class ProdosFileEntry extends ProdosCommonEntry implements FileEntry {
}
list.add(AppleUtil.getFormattedWord(getHeaderPointer()));
list.add(AppleUtil.getFormattedWord(getKeyPointer()));
list.add(isSaplingFile() ? textBundle.get("ProdosFileEntry.Sapling") : //$NON-NLS-1$
isSeedlingFile() ? textBundle.get("ProdosFileEntry.Seedling") : //$NON-NLS-1$
isTreeFile() ? textBundle.get("ProdosFileEntry.Tree") : //$NON-NLS-1$
textBundle.format("ProdosFileEntry.UnknownFileType", getFileTypeString())); //$NON-NLS-1$
list.add(isSaplingFile() ? textBundle.get("ProdosFileEntry.Sapling") :
isSeedlingFile() ? textBundle.get("ProdosFileEntry.Seedling") :
isTreeFile() ? textBundle.get("ProdosFileEntry.Tree") :
isPascalArea() ? textBundle.get("ProdosFileEntry.PascalArea") :
isExtendedFile() ? textBundle.get("ProdosFileEntry.Extended") :
isDirectory() ? textBundle.get("ProdosFileEntry.Directory") :
textBundle.format("ProdosFileEntry.UnknownFileType", getFileTypeString()));
list.add(hasChanged() ?
textBundle.get("ProdosFileEntry.Changed") : ""); //$NON-NLS-1$//$NON-NLS-2$
numberFormat.setMinimumIntegerDigits(1);

View File

@ -143,9 +143,9 @@ public class ShrinkItUtilities
if (resourceFork != null)
{
// If we have a resource fork in addition to a data fork,
// then we've got a GSOS storage type $5.
// then we've got a GSOS extended storage type $5.
newFile.setFileData(readThread(dataFork), readThread(resourceFork));
newFile.setStorageType(0x05);
newFile.setExtendedFile();
}
else
{

View File

@ -75,9 +75,9 @@ public class ProdosFileEntryReaderWriter implements FileEntryReader, FileEntryWr
public void setFileData(byte[] data, byte[] resource) {
try {
// If we have a resource fork in addition to a data fork,
// then we've got a GSOS storage type $5.
// then we've got a GSOS extended storage type $5.
fileEntry.setFileData(data, resource);
fileEntry.setStorageType(0x05);
fileEntry.setExtendedFile();
} catch (DiskFullException e) {
throw new RuntimeException(e);
}

View File

@ -119,6 +119,8 @@ ProdosFileEntry.Directory=Directory
ProdosFileEntry.Sapling=Sapling
ProdosFileEntry.Seedling=Seedling
ProdosFileEntry.Tree=Tree
ProdosFileEntry.PascalArea=Pascal Area
ProdosFileEntry.Extended=Extended
ProdosFileEntry.UnknownFileType=Unknown ({0})
ProdosFileEntry.Changed=Changed