Class PascalFileEntry

java.lang.Object
org.applecommander.os.pascal.PascalFileEntry
All Implemented Interfaces:
FileEntry, WritableFileEntry, PascalConstants, Container

public class PascalFileEntry extends Object implements WritableFileEntry, PascalConstants
  • Method Details

    • getOffset

      public int getOffset()
    • readEntry

      public DataBuffer readEntry()
    • modifyEntry

      public void modifyEntry(Consumer<DataBuffer> consumer)
    • getParent

      public Directory getParent()
      The Directory that holds this file.
      Specified by:
      getParent in interface FileEntry
    • isDeleted

      public boolean isDeleted()
      Indicates if this FileEntry is deleted.
      Specified by:
      isDeleted in interface FileEntry
    • getFileStore

      public FileStore getFileStore()
      Returns the FileStore that this Entry originates from.
      Specified by:
      getFileStore in interface FileEntry
    • getName

      public String getName()
      Returns the name of this entry: either a directory name or a file name. This does not contain any directory components -- strictly the name of this entry. Note that depending on context, this may be a computed field.
      Specified by:
      getName in interface FileEntry
    • setName

      public void setName(String name)
      Sets the name of this file. Uses the NAME_MAPPER to fix characters. This method only errors if, after applying the rules, the string is empty.
      Specified by:
      setName in interface WritableFileEntry
    • setDataFork

      public void setDataFork(DataBuffer data)
      Store the file's data. This does not include any metadata that may be embedded with the file.
      Specified by:
      setDataFork in interface WritableFileEntry
    • getFirstBlock

      public int getFirstBlock()
      Get the block number of the files first block.
    • setFirstBlock

      public void setFirstBlock(int firstBlock)
    • getLastBlock

      public int getLastBlock()
      Get the block number of the files last block + 1.
    • setLastBlock

      public void setLastBlock(int lastBlock)
    • getBlocksUsed

      public int getBlocksUsed()
    • getType

      public String getType()
    • setType

      public void setType(String type)
    • getBytesUsedInLastBlock

      public int getBytesUsedInLastBlock()
    • setBytesUsedInLastBlock

      public void setBytesUsedInLastBlock(int bytesUsedInLastBlock)
    • getLastModified

      public Date getLastModified()
    • setLastModified

      public void setLastModified(Date lastModified)
    • getSize

      public long getSize()
      Returns the size, in bytes, of this item. It may be approximate (based off a sector count, for instance).
      Specified by:
      getSize in interface FileEntry
    • getDataFork

      public DataBuffer getDataFork()
      Return the file's data. This does not include any metadata that may be embedded with the file.
      Specified by:
      getDataFork in interface FileEntry
    • getProdosAttributes

      public ProdosAttributes getProdosAttributes()
      Interpret the FileEntry as if it were on a ProDOS volume. The intention is that ProDOS ended up being the common denominator in many tools and formats, so this allows each file store to manage the interpretation itself.
      Specified by:
      getProdosAttributes in interface FileEntry
    • get

      public <T> Optional<T> get(Class<T> iface)
      Specified by:
      get in interface Container