Package org.zeroturnaround.zip.transform
Class ZipEntrySourceZipEntryTransformer
- java.lang.Object
-
- org.zeroturnaround.zip.transform.ZipEntrySourceZipEntryTransformer
-
- All Implemented Interfaces:
ZipEntryTransformer
public class ZipEntrySourceZipEntryTransformer extends java.lang.Object implements ZipEntryTransformer
-
-
Field Summary
Fields Modifier and Type Field Description private ZipEntrySource
source
-
Constructor Summary
Constructors Constructor Description ZipEntrySourceZipEntryTransformer(ZipEntrySource source)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static void
addEntry(ZipEntrySource entry, java.util.zip.ZipOutputStream out)
Adds a given ZIP entry to a ZIP file.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.
-
-
-
Field Detail
-
source
private final ZipEntrySource source
-
-
Constructor Detail
-
ZipEntrySourceZipEntryTransformer
public ZipEntrySourceZipEntryTransformer(ZipEntrySource source)
-
-
Method Detail
-
transform
public void transform(java.io.InputStream in, java.util.zip.ZipEntry zipEntry, java.util.zip.ZipOutputStream out) throws java.io.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 interfaceZipEntryTransformer
- Parameters:
in
- input stream of the entry contentszipEntry
- zip entry metadataout
- output stream to write transformed entry (if necessary)- Throws:
java.io.IOException
- if anything goes wrong
-
addEntry
static void addEntry(ZipEntrySource entry, java.util.zip.ZipOutputStream out) throws java.io.IOException
Adds a given ZIP entry to a ZIP file.- Parameters:
entry
- new ZIP entry.out
- target ZIP stream.- Throws:
java.io.IOException
-
-