Class Zips

java.lang.Object
org.openpreservation.format.zip.Zips

public final class Zips extends Object
Utility class for working with ZipArchives.
  • Method Details

    • extractorInstance

      public static final ZipEntryProcessor extractorInstance(Path root, boolean extractDirectories)
      Create a ZipEntryProcessor instance that processes the entries and extracts them to the supplied root Path.
      Parameters:
      root - the root Path to extract the entries to
      extractDirectories - true to extract directories, false to ignore them
      Returns:
      a ZipEntryProcessor that processes the entries and extracts them to the supplied root Path
    • factoryInstance

      public static final ZipProcessor.Factory factoryInstance()
      Create a ZipProcessor.Factory instance that can be used to create ZipProcessor instances.
      Returns:
      a ZipProcessor.Factory
    • zipArchiveCacheInstance

      public static final ZipArchiveCache zipArchiveCacheInstance(ZipArchive archive, Map<String,byte[]> cache)
      Create a ZipArchiveCache instance that caches the contents of the archive and provides access to the InputStreams.
      Parameters:
      archive - the ZipArchive to cache
      cache - the Map to use for caching
      Returns:
      a ZipArchiveCache instance that caches the contents of the archive and provides access to the InputStreams
    • zipArchiveCacheInstance

      public static final ZipArchiveCache zipArchiveCacheInstance(File file) throws IOException
      Create a ZipArchiveCache instance that caches the contents of the archive and provides access to the InputStreams.
      Parameters:
      file - the File to cache
      Returns:
      a ZipArchiveCache instance that caches the contents of the archive and provides access to the InputStreams
      Throws:
      IOException
    • zipArchiveCacheInstance

      public static final ZipArchiveCache zipArchiveCacheInstance(Path path) throws IOException
      Create a ZipArchiveCache instance that caches the contents of the archive and provides access to the Paths.
      Parameters:
      path - the Path to cache
      Returns:
      a ZipArchiveCache instance that caches the contents of the archive and provides access to the InputStreams
      Throws:
      IOException
    • zipEntryInstance

      public static final ZipEntry zipEntryInstance(String name, int size, int compressedSize, int crc32, int method, boolean isDirectory, byte[] extra)