com.webcodepro.applecommander.storage.os.prodos
Class ProdosCommonEntry

java.lang.Object
  extended by com.webcodepro.applecommander.storage.os.prodos.ProdosCommonEntry
Direct Known Subclasses:
ProdosCommonDirectoryHeader, ProdosFileEntry

public class ProdosCommonEntry
extends java.lang.Object

Represents the common Prodos entry behavior.

Date created: Oct 5, 2002 10:55:41 PM

Author:
Rob Greene

Field Summary
static int ENTRY_LENGTH
          The standard ProDOS file entry length.
 
Constructor Summary
ProdosCommonEntry(ProdosFormatDisk disk, int block, int offset)
          Constructor for ProdosCommonEntry.
 
Method Summary
 boolean canDestroy()
          Indicates if this file may be destroyed.
 boolean canRead()
          Indicates if this file may be read.
 boolean canRename()
          Indicates if this file may be renamed.
 boolean canWrite()
          Indicates if this file may be written.
protected  byte getAccess()
          Get the access byte.
 java.util.Date getCreationDate()
          Get the creation date.
protected  ProdosFormatDisk getDisk()
          Get the ProdosFormatDisk that this FileEntry is attached to.
protected  int getFileEntryBlock()
          Get the block in which the FileEntry resides.
 FormattedDisk getFormattedDisk()
          Get the FormattedDisk associated with this FileEntry.
 int getMinimumProdosVersion()
          Get the minimum version of ProDOS which can access this file.
 int getProdosVersion()
          Get the version of ProDOS that created this file.
protected  int getStorageType()
          Get storage type.
 boolean hasChanged()
          Indicates if this file has changed since last backup.
 boolean isEmpty()
          Indicates if this entry is empty - filled with $00.
 boolean isSaplingFile()
          Indicates if this is a "sapling" file (2 to 256 data blocks).
 boolean isSeedlingFile()
          Indicates if this is a "seedling" file (only one data block).
 boolean isSubdirectoryHeader()
          Indicates if this is a subdirectory header entry.
 boolean isTreeFile()
          Indicates if this is a "tree" file (257 to 32768 data blocks).
 boolean isVolumeHeader()
          Indicates if this is a volume header entry.
protected  byte[] readFileEntry()
          Read the fileEntry bytes from the disk image.
protected  void setAccess(int bit, boolean set)
          Set the access byte.
 void setCanDestroy(boolean destroy)
          Set if this file may be destroyed.
 void setCanRead(boolean read)
          Set if this file may be read.
 void setCanRename(boolean rename)
          Set if this file may be renamed.
 void setCanWrite(boolean write)
          Set if this file may be written.
 void setCreationDate(java.util.Date date)
          Set the creation date.
 void setHasChanged(boolean changed)
          Set if this file has changed since last backup.
 void setMinimumProdosVersion(int version)
          Set the minimum version of ProDOS which can access this file.
 void setProdosVersion(int version)
          Set the version of ProDOS that created this file.
 void setSaplingFile()
          Sets the storage type to a "sapling" file (2 to 256 data blocks).
 void setSeedlingFile()
          Sets the storage type to a "seedling" file (only one data block).
 void setStorageType(int storageType)
          Set the storage type.
 void setSubdirectoryHeader()
          Sets the storage type to a subdirectory header entry.
 void setTreeFile()
          Sets the storage type to a "tree" file (257 to 32768 data blocks).
 void setVolumeHeader()
          Sets the storage type to a volume header entry.
protected  void writeFileEntry(byte[] entry)
          Write the fileEntry data to the disk image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENTRY_LENGTH

public static final int ENTRY_LENGTH
The standard ProDOS file entry length.

See Also:
Constant Field Values
Constructor Detail

ProdosCommonEntry

public ProdosCommonEntry(ProdosFormatDisk disk,
                         int block,
                         int offset)
Constructor for ProdosCommonEntry.

Method Detail

getFileEntryBlock

protected int getFileEntryBlock()
Get the block in which the FileEntry resides.


getDisk

protected ProdosFormatDisk getDisk()
Get the ProdosFormatDisk that this FileEntry is attached to.


readFileEntry

protected byte[] readFileEntry()
Read the fileEntry bytes from the disk image.


isEmpty

public boolean isEmpty()
Indicates if this entry is empty - filled with $00.


writeFileEntry

protected void writeFileEntry(byte[] entry)
Write the fileEntry data to the disk image.


getStorageType

protected int getStorageType()
Get storage type.


setStorageType

public void setStorageType(int storageType)
Set the storage type.


isSeedlingFile

public boolean isSeedlingFile()
Indicates if this is a "seedling" file (only one data block).


setSeedlingFile

public void setSeedlingFile()
Sets the storage type to a "seedling" file (only one data block).


isSaplingFile

public boolean isSaplingFile()
Indicates if this is a "sapling" file (2 to 256 data blocks).


setSaplingFile

public void setSaplingFile()
Sets the storage type to a "sapling" file (2 to 256 data blocks).


isTreeFile

public boolean isTreeFile()
Indicates if this is a "tree" file (257 to 32768 data blocks).


setTreeFile

public void setTreeFile()
Sets the storage type to a "tree" file (257 to 32768 data blocks).


isSubdirectoryHeader

public boolean isSubdirectoryHeader()
Indicates if this is a subdirectory header entry.


setSubdirectoryHeader

public void setSubdirectoryHeader()
Sets the storage type to a subdirectory header entry.


isVolumeHeader

public boolean isVolumeHeader()
Indicates if this is a volume header entry.


setVolumeHeader

public void setVolumeHeader()
Sets the storage type to a volume header entry.


getCreationDate

public java.util.Date getCreationDate()
Get the creation date.


setCreationDate

public void setCreationDate(java.util.Date date)
Set the creation date.


getProdosVersion

public int getProdosVersion()
Get the version of ProDOS that created this file.


setProdosVersion

public void setProdosVersion(int version)
Set the version of ProDOS that created this file.


getMinimumProdosVersion

public int getMinimumProdosVersion()
Get the minimum version of ProDOS which can access this file.


setMinimumProdosVersion

public void setMinimumProdosVersion(int version)
Set the minimum version of ProDOS which can access this file.


getAccess

protected byte getAccess()
Get the access byte.


setAccess

protected void setAccess(int bit,
                         boolean set)
Set the access byte.


canDestroy

public boolean canDestroy()
Indicates if this file may be destroyed.


setCanDestroy

public void setCanDestroy(boolean destroy)
Set if this file may be destroyed.


canRename

public boolean canRename()
Indicates if this file may be renamed.


setCanRename

public void setCanRename(boolean rename)
Set if this file may be renamed.


hasChanged

public boolean hasChanged()
Indicates if this file has changed since last backup.


setHasChanged

public void setHasChanged(boolean changed)
Set if this file has changed since last backup.


canWrite

public boolean canWrite()
Indicates if this file may be written.


setCanWrite

public void setCanWrite(boolean write)
Set if this file may be written.


canRead

public boolean canRead()
Indicates if this file may be read.


setCanRead

public void setCanRead(boolean read)
Set if this file may be read.


getFormattedDisk

public FormattedDisk getFormattedDisk()
Get the FormattedDisk associated with this FileEntry. This is useful to interfaces that need to retrieve the associated disk.