Class ZipFileProcessor

java.lang.Object
org.openpreservation.format.zip.ZipFileProcessor
All Implemented Interfaces:
ZipArchive, ZipArchiveCache

public final class ZipFileProcessor extends Object implements ZipArchiveCache
An implementation of ZipArchiveCache that caches the contents of the archive and provides access to the InputStreams.
  • Method Details

    • getZipEntries

      public List<ZipEntry> getZipEntries()
      Description copied from interface: ZipArchive
      Get a List of all of the zip entries in the archive
      Specified by:
      getZipEntries in interface ZipArchive
      Returns:
      an ordered List of all of the zip entries in the archive
    • getFirstEntry

      public ZipEntry getFirstEntry()
      Returns the first physical ZipEntry in the archive.
      Specified by:
      getFirstEntry in interface ZipArchive
      Returns:
      the first physical ZipEntry in the archive
    • getZipEntry

      public ZipEntry getZipEntry(String entryName)
      Description copied from interface: ZipArchive
      Retrieve a ZipEntry by entry name, equivalent to the path.
      Specified by:
      getZipEntry in interface ZipArchive
      Parameters:
      entryName - the name of the ZipEntry to retrieve
      Returns:
      the ZipEntry with the given entryName, or null if no match
    • size

      public int size()
      Description copied from interface: ZipArchive
      Get the count of entries in the archive
      Specified by:
      size in interface ZipArchive
      Returns:
      int number of ZipEntries in the archive
    • getCachedEntryNames

      public List<String> getCachedEntryNames()
      Description copied from interface: ZipArchiveCache
      Get a List of all of the cached entries in the archive
      Specified by:
      getCachedEntryNames in interface ZipArchiveCache
      Returns:
    • getEntryInputStream

      public InputStream getEntryInputStream(String entryName) throws IOException
      Description copied from interface: ZipArchiveCache
      Get the InputStream for the entry with the passed name, equivalent to the path.
      Specified by:
      getEntryInputStream in interface ZipArchiveCache
      Returns:
      the InputStream for the entry with the passed name, or null if no match
      Throws:
      IOException