Added ability to set values; work is done from readFileEntry and

writeFileEntry.
This commit is contained in:
Robert Greene 2002-12-12 01:55:36 +00:00
parent 6f3ef71add
commit 4b037eb100

View File

@ -31,14 +31,23 @@ public class ProdosVolumeDirectoryHeader extends ProdosCommonDirectoryHeader {
* Constructor for ProdosVolumeDirectoryHeaderEntry. * Constructor for ProdosVolumeDirectoryHeaderEntry.
* @param fileEntry * @param fileEntry
*/ */
public ProdosVolumeDirectoryHeader(byte[] fileEntry) { public ProdosVolumeDirectoryHeader(ProdosFormatDisk disk) {
super(fileEntry); super(disk, 2);
} }
/** /**
* Return the name of this volume. * Return the name of this volume.
*/ */
public String getVolumeName() { public String getVolumeName() {
return AppleUtil.getProdosString(getFileEntry(), 0); return AppleUtil.getProdosString(readFileEntry(), 0);
}
/**
* Set the name of this volume.
*/
public void setVolumeName(String volumeName) {
byte[] data = readFileEntry();
AppleUtil.setProdosString(data, 0, volumeName.toUpperCase(), 15);
writeFileEntry(data);
} }
} }