Package org.zeroturnaround.zip.transform
Class FileZipEntryTransformer
- java.lang.Object
-
- org.zeroturnaround.zip.transform.FileZipEntryTransformer
-
- All Implemented Interfaces:
ZipEntryTransformer
public abstract class FileZipEntryTransformer extends java.lang.Object implements ZipEntryTransformer
-
-
Constructor Summary
Constructors Constructor Description FileZipEntryTransformer()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private static void
copy(java.io.InputStream in, java.io.File file)
void
transform(java.io.InputStream in, java.util.zip.ZipEntry zipEntry, java.util.zip.ZipOutputStream out)
Copies the input stream to the file, then transforms the file.protected abstract void
transform(java.util.zip.ZipEntry zipEntry, java.io.File in, java.io.File out)
Copies and transforms the given file into the output file.
-
-
-
Method Detail
-
transform
protected abstract void transform(java.util.zip.ZipEntry zipEntry, java.io.File in, java.io.File out) throws java.io.IOException
Copies and transforms the given file into the output file.- Parameters:
zipEntry
- zip entry metadatain
- zip entry contentsout
- file to write transformed contents- Throws:
java.io.IOException
- if file is not found or writing to it fails
-
transform
public void transform(java.io.InputStream in, java.util.zip.ZipEntry zipEntry, java.util.zip.ZipOutputStream out) throws java.io.IOException
Copies the input stream to the file, then transforms the file. FileSource is added then to the output stream.- Specified by:
transform
in interfaceZipEntryTransformer
- Parameters:
in
- input stream of the entry contentszipEntry
- zip entry metadataout
- ignored, because we're working on files- Throws:
java.io.IOException
- if anything goes wrong
-
copy
private static void copy(java.io.InputStream in, java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
-