Package com.itextpdf.commons.utils
Class ZipFileWriter
java.lang.Object
com.itextpdf.commons.utils.ZipFileWriter
- All Implemented Interfaces:
-
Closeable,AutoCloseable
Allows writing entries into a zip file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd file from disk into zip archive.voidaddEntry(String fileName, InputStream inputStream) Add file into zip archive with data from stream.voidaddJsonEntry(String fileName, Object objectToAdd) Deprecated.Not used anywherevoidclose()
-
Constructor Details
-
ZipFileWriter
Creates an instance for zip file writing.- Parameters:
-
archivePath- the path to the zip file to write - Throws:
-
IOException- if some I/O exception occurs
-
-
Method Details
-
addEntry
Add file from disk into zip archive.- Parameters:
-
fileName- the target name of the file inside zip after writing -
file- the path to the file on disk to archive - Throws:
-
IOException- if some I/O exception occurs
-
addEntry
Add file into zip archive with data from stream.- Parameters:
-
fileName- the target name of the file inside zip after writing -
inputStream- the input stream to archive - Throws:
-
IOException- if some I/O exception occurs
-
addJsonEntry
Deprecated.Not used anywhereAdd file into zip archive with object serialized as JSON.- Parameters:
-
fileName- the target name of the file inside zip after writing -
objectToAdd- the object to serialize as JSON - Throws:
-
IOException- if some I/O exception occurs
-
close
- Specified by:
-
closein interfaceAutoCloseable - Specified by:
-
closein interfaceCloseable - Throws:
-
IOException
-