Class ProdosCommonEntry
- java.lang.Object
-
- com.webcodepro.applecommander.storage.os.prodos.ProdosCommonEntry
-
- Direct Known Subclasses:
ProdosCommonDirectoryHeader,ProdosFileEntry
public class ProdosCommonEntry extends java.lang.ObjectRepresents the common Prodos entry behavior.Date created: Oct 5, 2002 10:55:41 PM
-
-
Field Summary
Fields Modifier and Type Field Description static intENTRY_LENGTHThe standard ProDOS file entry length.
-
Constructor Summary
Constructors Constructor Description ProdosCommonEntry(ProdosFormatDisk disk, int block, int offset)Constructor for ProdosCommonEntry.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanDestroy()Indicates if this file may be destroyed.booleancanRead()Indicates if this file may be read.booleancanRename()Indicates if this file may be renamed.booleancanWrite()Indicates if this file may be written.protected bytegetAccess()Get the access byte.java.util.DategetCreationDate()Get the creation date.protected ProdosFormatDiskgetDisk()Get the ProdosFormatDisk that this FileEntry is attached to.protected intgetFileEntryBlock()Get the block in which the FileEntry resides.FormattedDiskgetFormattedDisk()Get the FormattedDisk associated with this FileEntry.intgetMinimumProdosVersion()Get the minimum version of ProDOS which can access this file.intgetProdosVersion()Get the version of ProDOS that created this file.protected intgetStorageType()Get storage type.booleanhasChanged()Indicates if this file has changed since last backup.booleanisEmpty()Indicates if this entry is empty - filled with $00.booleanisSaplingFile()Indicates if this is a "sapling" file (2 to 256 data blocks).booleanisSeedlingFile()Indicates if this is a "seedling" file (only one data block).booleanisSubdirectory()Indicates if this is a subdirectory entry.booleanisSubdirectoryHeader()Indicates if this is a subdirectory header entry.booleanisTreeFile()Indicates if this is a "tree" file (257 to 32768 data blocks).booleanisVolumeHeader()Indicates if this is a volume header entry.protected byte[]readFileEntry()Read the fileEntry bytes from the disk image.protected voidsetAccess(int bit, boolean set)Set the access byte.voidsetCanDestroy(boolean destroy)Set if this file may be destroyed.voidsetCanRead(boolean read)Set if this file may be read.voidsetCanRename(boolean rename)Set if this file may be renamed.voidsetCanWrite(boolean write)Set if this file may be written.voidsetCreationDate(java.util.Date date)Set the creation date.voidsetHasChanged(boolean changed)Set if this file has changed since last backup.voidsetMinimumProdosVersion(int version)Set the minimum version of ProDOS which can access this file.voidsetProdosVersion(int version)Set the version of ProDOS that created this file.voidsetSaplingFile()Sets the storage type to a "sapling" file (2 to 256 data blocks).voidsetSeedlingFile()Sets the storage type to a "seedling" file (only one data block).voidsetStorageType(int storageType)Set the storage type.voidsetSubdirectory()Sets the storage type to a subdirectory entry.voidsetSubdirectoryHeader()Sets the storage type to a subdirectory header entry.voidsetTreeFile()Sets the storage type to a "tree" file (257 to 32768 data blocks).voidsetVolumeHeader()Sets the storage type to a volume header entry.protected voidwriteFileEntry(byte[] entry)Write the fileEntry data to the disk image.
-
-
-
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).
-
isSubdirectory
public boolean isSubdirectory()
Indicates if this is a subdirectory entry.
-
setSubdirectory
public void setSubdirectory()
Sets the storage type to a subdirectory entry.
-
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.
-
-