mirror of
https://github.com/AppleCommander/AppleCommander.git
synced 2024-12-31 22:30:16 +00:00
Updated to adhere to the DirectoryEntry interface; removed
entries covered by DirectoryEntry.
This commit is contained in:
parent
5ef9a886b1
commit
8494c31989
@ -32,7 +32,7 @@ import java.util.List;
|
|||||||
* Date created: Oct 5, 2002 3:51:44 PM
|
* Date created: Oct 5, 2002 3:51:44 PM
|
||||||
* @author: Rob Greene
|
* @author: Rob Greene
|
||||||
*/
|
*/
|
||||||
public abstract class FormattedDisk extends Disk {
|
public abstract class FormattedDisk extends Disk implements DirectoryEntry {
|
||||||
/**
|
/**
|
||||||
* Use this inner class for label/value mappings in the disk info page.
|
* Use this inner class for label/value mappings in the disk info page.
|
||||||
*/
|
*/
|
||||||
@ -126,26 +126,11 @@ public abstract class FormattedDisk extends Disk {
|
|||||||
super(filename, diskImage);
|
super(filename, diskImage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Identify if this disk format is capable of having directories.
|
|
||||||
*/
|
|
||||||
public abstract boolean canHaveDirectories();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the name of the disk. Not the physical file name,
|
* Return the name of the disk. Not the physical file name,
|
||||||
* but "DISK VOLUME #xxx" (DOS 3.3) or "/MY.DISK" (ProDOS).
|
* but "DISK VOLUME #xxx" (DOS 3.3) or "/MY.DISK" (ProDOS).
|
||||||
*/
|
*/
|
||||||
public abstract String getDiskName();
|
public abstract String getDiskName();
|
||||||
|
|
||||||
/**
|
|
||||||
* Retrieve a list of files.
|
|
||||||
*/
|
|
||||||
public abstract List getFiles();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new FileEntry.
|
|
||||||
*/
|
|
||||||
public abstract FileEntry createFile() throws DiskFullException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Identify the operating system format of this disk.
|
* Identify the operating system format of this disk.
|
||||||
@ -245,13 +230,11 @@ public abstract class FormattedDisk extends Disk {
|
|||||||
* to something specific about the disk (such as read-only image).
|
* to something specific about the disk (such as read-only image).
|
||||||
*/
|
*/
|
||||||
public abstract boolean canWriteFileData();
|
public abstract boolean canWriteFileData();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if this disk image can create a file.
|
* Identify if this disk format is capable of having directories.
|
||||||
* If not, the reason may be as simple as it has not beem implemented
|
|
||||||
* to something specific about the disk.
|
|
||||||
*/
|
*/
|
||||||
public abstract boolean canCreateFile();
|
public abstract boolean canHaveDirectories();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if this disk image can delete a file.
|
* Indicates if this disk image can delete a file.
|
||||||
@ -290,7 +273,8 @@ public abstract class FormattedDisk extends Disk {
|
|||||||
for (int i=0; i<files.size(); i++) {
|
for (int i=0; i<files.size(); i++) {
|
||||||
FileEntry entry = (FileEntry) files.get(i);
|
FileEntry entry = (FileEntry) files.get(i);
|
||||||
if (entry.isDirectory()) {
|
if (entry.isDirectory()) {
|
||||||
theFileEntry = getFile(entry.getFiles(), filename);
|
theFileEntry = getFile(
|
||||||
|
((DirectoryEntry)entry).getFiles(), filename);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
String otherFilename = entry.getFilename();
|
String otherFilename = entry.getFilename();
|
||||||
@ -361,4 +345,13 @@ public abstract class FormattedDisk extends Disk {
|
|||||||
* Indicates if this filetype requires an address component.
|
* Indicates if this filetype requires an address component.
|
||||||
*/
|
*/
|
||||||
public abstract boolean needsAddress(String filetype);
|
public abstract boolean needsAddress(String filetype);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the FormattedDisk associated with this DirectoryEntry.
|
||||||
|
* This is useful to interfaces that need to retrieve the associated
|
||||||
|
* disk.
|
||||||
|
*/
|
||||||
|
public FormattedDisk getFormattedDisk() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user