Class ByteArrayZipEntryTransformer

java.lang.Object
org.zeroturnaround.zip.transform.ByteArrayZipEntryTransformer
All Implemented Interfaces:
ZipEntryTransformer

public abstract class ByteArrayZipEntryTransformer extends Object implements ZipEntryTransformer
  • Constructor Details

    • ByteArrayZipEntryTransformer

      public ByteArrayZipEntryTransformer()
  • Method Details

    • transform

      protected abstract byte[] transform(ZipEntry zipEntry, byte[] input) throws IOException
      Transforms the given byte array into a new one.
      Parameters:
      zipEntry - entry to transform
      input - entry contents
      Returns:
      byte[] the transformed contents of the entry
      Throws:
      IOException - if anything goes wrong
    • transform

      public void transform(InputStream in, ZipEntry zipEntry, ZipOutputStream out) throws IOException
      Transforms the zip entry given as an input stream and ZipEntry metadata. The result is written to a ZipOutputStream * @param in input stream of the entry contents
      Specified by:
      transform in interface ZipEntryTransformer
      Parameters:
      in - input stream of the entry contents
      zipEntry - zip entry metadata
      out - output stream to write transformed entry
      Throws:
      IOException - if anything goes wrong
    • preserveTimestamps

      protected boolean preserveTimestamps()
      Override to return true if needed.
      Returns:
      true if this transformer should preserve timestamp of the entry it transforms, false otherwise