Class StringZipEntryTransformer

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

public abstract class StringZipEntryTransformer extends Object implements ZipEntryTransformer
  • Field Details

    • encoding

      private final String encoding
      The encoding to use, null means platform default.
  • Constructor Details

    • StringZipEntryTransformer

      public StringZipEntryTransformer()
    • StringZipEntryTransformer

      public StringZipEntryTransformer(String encoding)
  • Method Details

    • transform

      protected abstract String transform(ZipEntry zipEntry, String input) throws IOException
      Transforms the given String into a new one.
      Parameters:
      zipEntry - zip entry metadata
      input - zip entry contents
      Returns:
      String - transformed entry contents
      Throws:
      IOException - if transformation cannot be completed succesfully
    • transform

      public void transform(InputStream in, ZipEntry zipEntry, ZipOutputStream out) throws IOException
      Description copied from interface: ZipEntryTransformer
      Transforms the zip entry given as an input stream and ZipEntry metadata. The result is written to a ZipOutputStream
      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 (if necessary)
      Throws:
      IOException - if anything goes wrong