Added getFiletypes (all possible filetypes) and needsAddress.

This commit is contained in:
Robert Greene 2003-02-11 04:35:04 +00:00
parent ecf6f16a83
commit 6c8dad1ea7
4 changed files with 82 additions and 0 deletions

View File

@ -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);
}
}

View File

@ -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);
}

View File

@ -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;
}
}

View File

@ -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);
}
}