Updated to adhere to the DirectoryEntry interface.

This commit is contained in:
Robert Greene 2003-03-06 03:43:21 +00:00
parent cd8af8fc82
commit a9ea9738c0
3 changed files with 62 additions and 28 deletions

View File

@ -170,12 +170,23 @@ public class DosFormatDisk extends FormattedDisk {
}
/**
* Identify if this disk format as not capable of having directories.
* @see com.webcodepro.applecommander.storage.Disk#hasDirectories()
* Identify if additional directories can be created. This
* may indicate that directories are not available to this
* operating system or simply that the disk image is "locked"
* to writing.
*/
public boolean canHaveDirectories() {
public boolean canCreateDirectories() {
return false;
}
/**
* Indicates if this disk image can create a file.
* If not, the reason may be as simple as it has not beem implemented
* to something specific about the disk.
*/
public boolean canCreateFile() {
return true;
}
/**
* Compute the amount of freespace available on the disk.
@ -361,10 +372,11 @@ public class DosFormatDisk extends FormattedDisk {
}
/**
* Indicates if this disk image can create a file.
* Identify if this disk format as not capable of having directories.
* @see com.webcodepro.applecommander.storage.Disk#hasDirectories()
*/
public boolean canCreateFile() {
return true;
public boolean canHaveDirectories() {
return false;
}
/**

View File

@ -154,8 +154,26 @@ public class PascalFormatDisk extends FormattedDisk {
* Create a new FileEntry.
*/
public FileEntry createFile() throws DiskFullException {
// FIXME: Need to implement!
return null;
throw new DiskFullException("Unable to create files (yet).");
}
/**
* Identify if additional directories can be created. This
* may indicate that directories are not available to this
* operating system or simply that the disk image is "locked"
* to writing.
*/
public boolean canCreateDirectories() {
return false;
}
/**
* Indicates if this disk image can create a file.
* If not, the reason may be as simple as it has not beem implemented
* to something specific about the disk.
*/
public boolean canCreateFile() {
return false;
}
/**
@ -389,13 +407,6 @@ public class PascalFormatDisk extends FormattedDisk {
return false; // FIXME - not implemented
}
/**
* Indicates if this disk image can create a file.
*/
public boolean canCreateFile() {
return false; // FIXME - not implemented
}
/**
* Indicates if this disk image can delete a file.
*/

View File

@ -164,13 +164,6 @@ public class RdosFormatDisk extends FormattedDisk {
writeSector(track, sector, data);
}
/**
* RDOS dos not support directories.
*/
public boolean canHaveDirectories() {
return false;
}
/**
* RDOS really does not have a disk name. Fake one.
*/
@ -202,8 +195,26 @@ public class RdosFormatDisk extends FormattedDisk {
* Create a new FileEntry.
*/
public FileEntry createFile() throws DiskFullException {
// FIXME: Need to implement!
return null;
throw new DiskFullException("Cannot create a file (yet).");
}
/**
* Identify if additional directories can be created. This
* may indicate that directories are not available to this
* operating system or simply that the disk image is "locked"
* to writing.
*/
public boolean canCreateDirectories() {
return false;
}
/**
* Indicates if this disk image can create a file.
* If not, the reason may be as simple as it has not beem implemented
* to something specific about the disk.
*/
public boolean canCreateFile() {
return false; // FIXME - need to implement
}
/**
@ -339,12 +350,12 @@ public class RdosFormatDisk extends FormattedDisk {
}
/**
* Indicates if this disk image can create a file.
* RDOS dos not support directories.
*/
public boolean canCreateFile() {
return false; // FIXME - not implemented
public boolean canHaveDirectories() {
return false;
}
/**
* Indicates if this disk image can delete a file.
*/