Skip to content
Reference > Classes

ZipBuilder

Definition

ZipBuilder var = .... ;

Extends

Extended By

None

Description

Used for Building a zip file by adding individual files

Method Summary

Owner Name Return Type Description
ZipBuilder constructor() ZipBuilder Constructs a new empty ZipBuilder
ZipBuilder addFile(fileName, data) Boolean Adds the file as an entry to the zip file given the filename and data. Returns false if filename is not valid, data is null or the build() has already been called, which indicates the file was not added. Otherwise returns true.
ZipBuilder addFile(fileName, data, modifiedTimestamp) Boolean Adds the file as an entry to the zip file given the filename, data, and the modified timestamp. Returns false if filename is not valid, data is null or the build() has already been called, which indicates the file was not added. Otherwise returns true.
ZipBuilder build() Binary Returns a Byte representing a zip file.
Object getClassName() String Returns the string name of this object's class type.
Object toJson() String Returns a json representation of this object.

Method Definitions


constructor()

ZipBuilder zipbuilder = new ZipBuilder()

Description

Constructs a new empty ZipBuilder


addFile(fileName,data)

Boolean ZipBuilder::addFile(String fileName, Binary data)

Description

Adds the file as an entry to the zip file given the filename and data. Returns false if filename is not valid, data is null or the build() has already been called, which indicates the file was not added. Otherwise returns true.

Parameter Definition

Name Type Description
fileName String 
data Binary 

addFile(fileName,data,modifiedTimestamp)

Boolean ZipBuilder::addFile(String fileName, Binary data, UTC modifiedTimestamp)

Description

Adds the file as an entry to the zip file given the filename, data, and the modified timestamp. Returns false if filename is not valid, data is null or the build() has already been called, which indicates the file was not added. Otherwise returns true.

Parameter Definition

Name Type Description
fileName String  fileName of the entry to add
data Binary  data of the entry to add
modifiedTimestamp UTC  modified timestamp of the entry to add

build()

Binary ZipBuilder::build()

Description

Returns a Byte representing a zip file.