mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2024-12-26 03:33:00 +00:00
Correcting acx import
from an AppleSingle file to setup binary address correctly. #108
This commit is contained in:
parent
852fbeb4b3
commit
643de4b4b1
@ -304,10 +304,13 @@ public class ImportCommand extends ReadWriteDiskCommandOptions {
|
||||
|
||||
OverrideFileEntryReader.Builder builder = OverrideFileEntryReader.builder();
|
||||
builder.filename(Optional.ofNullable(as.getRealName()));
|
||||
builder.prodosFiletype(fileType);
|
||||
builder.locked((info.getAccess()&0xc2) != 0xc2); //Unlocked if destroy, rename and write are all enabled
|
||||
builder.fileData(as.getDataFork());
|
||||
builder.resourceData(Optional.ofNullable(as.getResourceFork()));
|
||||
builder.prodosFiletype(fileType);
|
||||
builder.locked((info.getAccess()&0xc2) != 0xc2); //Unlocked if destory, rename and write are all enabled
|
||||
if (ProdosFormatDisk.fileTypeNeedsAddress(fileType)) {
|
||||
builder.binaryAddress(info.getAuxType());
|
||||
}
|
||||
builder.auxiliaryType(info.getAuxType());
|
||||
|
||||
if (as.getFileDatesInfo() != null) {
|
||||
|
@ -1286,7 +1286,7 @@ public class ProdosFormatDisk extends FormattedDisk {
|
||||
/**
|
||||
* Locate the associated ProdosFileType.
|
||||
*/
|
||||
public static ProdosFileType findFileType(String filetype) {
|
||||
static ProdosFileType findFileType(String filetype) {
|
||||
for (int i=0; i<fileTypes.length; i++) {
|
||||
if (filetype.equalsIgnoreCase(fileTypes[i].getString())) {
|
||||
return fileTypes[i];
|
||||
@ -1295,6 +1295,17 @@ public class ProdosFormatDisk extends FormattedDisk {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility method to indicate if this file type needs an address.
|
||||
*/
|
||||
public static boolean fileTypeNeedsAddress(String filetype) {
|
||||
ProdosFileType prodosFileType = findFileType(filetype);
|
||||
if (prodosFileType != null) {
|
||||
return prodosFileType.needsAddress();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of possible file types. Since the filetype is
|
||||
* specific to each operating system, a simple String is used.
|
||||
|
Loading…
Reference in New Issue
Block a user