Package org.zeroturnaround.zip.transform
Class ByteArrayZipEntryTransformer
- java.lang.Object
-
- org.zeroturnaround.zip.transform.ByteArrayZipEntryTransformer
-
- All Implemented Interfaces:
ZipEntryTransformer
public abstract class ByteArrayZipEntryTransformer extends java.lang.Object implements ZipEntryTransformer
-
-
Constructor Summary
Constructors Constructor Description ByteArrayZipEntryTransformer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean
preserveTimestamps()
Override to return true if needed.void
transform(java.io.InputStream in, java.util.zip.ZipEntry zipEntry, java.util.zip.ZipOutputStream out)
Transforms the zip entry given as an input stream and ZipEntry metadata.protected abstract byte[]
transform(java.util.zip.ZipEntry zipEntry, byte[] input)
Transforms the given byte array into a new one.
-
-
-
Method Detail
-
transform
protected abstract byte[] transform(java.util.zip.ZipEntry zipEntry, byte[] input) throws java.io.IOException
Transforms the given byte array into a new one.- Parameters:
zipEntry
- entry to transforminput
- entry contents- Returns:
- byte[] the transformed contents of the entry
- Throws:
java.io.IOException
- if anything goes wrong
-
transform
public void transform(java.io.InputStream in, java.util.zip.ZipEntry zipEntry, java.util.zip.ZipOutputStream out) throws java.io.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 interfaceZipEntryTransformer
- Parameters:
zipEntry
- zip entry metadataout
- output stream to write transformed entryin
- input stream of the entry contents- Throws:
java.io.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
-
-