mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2024-12-22 08:30:35 +00:00
Added getFiletypes (all possible filetypes) and needsAddress.
This commit is contained in:
parent
ecf6f16a83
commit
6c8dad1ea7
@ -49,6 +49,12 @@ public class DosFormatDisk extends FormattedDisk {
|
||||
* The standard track/sector pairs in a track/sector list.
|
||||
*/
|
||||
public static final int TRACK_SECTOR_PAIRS = 122;
|
||||
/**
|
||||
* The list of filetypes available.
|
||||
*/
|
||||
private static final String[] filetypes = {
|
||||
"T", "A", "I", "B", "S", "R", "a", "b"
|
||||
};
|
||||
|
||||
/**
|
||||
* Use this inner interface for managing the disk usage data.
|
||||
@ -637,4 +643,20 @@ public class DosFormatDisk extends FormattedDisk {
|
||||
int len = Math.min(filename.length(), 30);
|
||||
return filename.toUpperCase().substring(0, len).trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of possible file types. Since the filetype is
|
||||
* specific to each operating system, a simple String is used.
|
||||
*/
|
||||
public String[] getFiletypes() {
|
||||
return filetypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if this filetype requires an address component.
|
||||
* For DOS, only the Binary type needs an address.
|
||||
*/
|
||||
public boolean needsAddress(String filetype) {
|
||||
return "B".equals(filetype);
|
||||
}
|
||||
}
|
||||
|
@ -342,4 +342,15 @@ public abstract class FormattedDisk extends Disk {
|
||||
* the filename.
|
||||
*/
|
||||
public abstract String getSuggestedFilename(String filename);
|
||||
|
||||
/**
|
||||
* Returns a list of possible file types. Since the filetype is
|
||||
* specific to each operating system, a simple String is used.
|
||||
*/
|
||||
public abstract String[] getFiletypes();
|
||||
|
||||
/**
|
||||
* Indicates if this filetype requires an address component.
|
||||
*/
|
||||
public abstract boolean needsAddress(String filetype);
|
||||
}
|
||||
|
@ -40,6 +40,18 @@ public class PascalFormatDisk extends FormattedDisk {
|
||||
* The number of Pascal blocks on a 140K disk.
|
||||
*/
|
||||
public static final int PASCAL_BLOCKS_ON_140K_DISK = 280;
|
||||
/**
|
||||
* The know filetypes for a Pascal disk.
|
||||
*/
|
||||
private static final String[] filetypes = {
|
||||
"xdskfile",
|
||||
"codefile",
|
||||
"textfile",
|
||||
"infofile",
|
||||
"datafile",
|
||||
"graffile",
|
||||
"fotofile",
|
||||
"securedir" };
|
||||
|
||||
/**
|
||||
* Use this inner interface for managing the disk usage data.
|
||||
@ -455,4 +467,20 @@ public class PascalFormatDisk extends FormattedDisk {
|
||||
}
|
||||
return newName.toString().toUpperCase().trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of possible file types. Since the filetype is
|
||||
* specific to each operating system, a simple String is used.
|
||||
*/
|
||||
public String[] getFiletypes() {
|
||||
return filetypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if this filetype requires an address component.
|
||||
* No Pascal filetypes require or support an address.
|
||||
*/
|
||||
public boolean needsAddress(String filetype) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -60,6 +60,10 @@ public class RdosFormatDisk extends FormattedDisk {
|
||||
* RDOS apparantly only worked on 5.25" disks.
|
||||
*/
|
||||
public static final int BLOCKS_ON_DISK = 455;
|
||||
/**
|
||||
* The known filetypes for a RDOS disk.
|
||||
*/
|
||||
public static final String[] filetypes = { "B", "A", "T" };
|
||||
|
||||
/**
|
||||
* Use this inner interface for managing the disk usage data.
|
||||
@ -416,4 +420,21 @@ public class RdosFormatDisk extends FormattedDisk {
|
||||
int len = Math.min(filename.length(), 24);
|
||||
return filename.toUpperCase().substring(0, len).trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a list of possible file types. Since the filetype is
|
||||
* specific to each operating system, a simple String is used.
|
||||
*/
|
||||
public String[] getFiletypes() {
|
||||
return filetypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates if this filetype requires an address component.
|
||||
* Presumably, the "B" filetype is binary and will need an
|
||||
* address.
|
||||
*/
|
||||
public boolean needsAddress(String filetype) {
|
||||
return "B".equals(filetype);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user