iText 8.0.2 API
iText.Commons.Utils.ZipFileWriter Class Reference

Allows writing entries into a zip file. More...

Inheritance diagram for iText.Commons.Utils.ZipFileWriter:

Public Member Functions

  ZipFileWriter (String archivePath)
  Creates an instance for zip file writing. More...
 
void  AddEntry (String fileName, FileInfo file)
  Add file from disk into zip archive. More...
 
void  AddEntry (String fileName, Stream inputStream)
  Add file into zip archive with data from stream. More...
 
void  AddJsonEntry (String fileName, Object objectToAdd)
  Add file into zip archive with object serialized as JSON. More...
 
void  Dispose ()
 

Detailed Description

Allows writing entries into a zip file.

Constructor & Destructor Documentation

◆ ZipFileWriter()

iText.Commons.Utils.ZipFileWriter.ZipFileWriter ( String  archivePath )
inline

Creates an instance for zip file writing.

Parameters
archivePath the path to the zip file to write
Exceptions
IOException if some I/O exception occurs

Member Function Documentation

◆ AddEntry() [1/2]

void iText.Commons.Utils.ZipFileWriter.AddEntry ( String  fileName,
FileInfo  file 
)
inline

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
Exceptions
IOException if some I/O exception occurs

◆ AddEntry() [2/2]

void iText.Commons.Utils.ZipFileWriter.AddEntry ( String  fileName,
Stream  inputStream 
)
inline

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
Exceptions
IOException if some I/O exception occurs

◆ AddJsonEntry()

void iText.Commons.Utils.ZipFileWriter.AddJsonEntry ( String  fileName,
Object  objectToAdd 
)
inline

Add 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
Exceptions
IOException if some I/O exception occurs