Class ZipFileEntry

java.lang.Object
org.applecommander.archive.zip.ZipFileEntry
All Implemented Interfaces:
FileEntry, WritableFileEntry, Container

public class ZipFileEntry extends Object implements WritableFileEntry
  • Constructor Details

    • ZipFileEntry

      public ZipFileEntry(ZipFileStore fileStore, int entryNumber, ZipEntry entry)
      Create a ZipFileEntry that is backed by an existing Zip file and the specific entry involved.
    • ZipFileEntry

      public ZipFileEntry(ZipFileStore fileStore, String fileName)
      Create a new ZipFileEntry that does NOT exist in the zip file (yet).
  • Method Details

    • getParent

      public Directory getParent()
      Description copied from interface: FileEntry
      The parent Directory, if applicable. Can return null if this is the root directory.
      Specified by:
      getParent in interface FileEntry
    • isDeleted

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

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

      public String getName()
      Description copied from interface: FileEntry
      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)
      Description copied from interface: WritableFileEntry
      Allows the name of this entry to be changed (depending on the Capability allowed by the underlying FileStore).
      Specified by:
      setName in interface WritableFileEntry
    • getSize

      public long getSize()
      Description copied from interface: FileEntry
      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
    • getCreationTime

      public FileTime getCreationTime()
    • setCreationTime

      public void setCreationTime(FileTime creationTime)
    • getLastModifiedTime

      public FileTime getLastModifiedTime()
    • setLastModifiedTime

      public void setLastModifiedTime(FileTime lastModifiedTime)
    • getLastAccessTime

      public FileTime getLastAccessTime()
    • setLastAccessTime

      public void setLastAccessTime(FileTime lastAccessTime)
    • getCrc

      public long getCrc()
    • getCompressedSize

      public long getCompressedSize()
    • getComment

      public String getComment()
    • setComment

      public void setComment(String comment)
    • getMethod

      public int getMethod()
    • getMethodName

      public String getMethodName()
    • getDataFork

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

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

      public ProdosAttributes getProdosAttributes()
      Description copied from interface: FileEntry
      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
    • getContentType

      public ContentType getContentType()
      Description copied from interface: FileEntry
      Return the type of content, if known. It should never return null; use UNKNOWN if not known.
      Specified by:
      getContentType in interface FileEntry
      See Also:
    • get

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