public class ZipBuilder extends Object
| Constructor and Description |
|---|
ZipBuilder(String name) |
| Modifier and Type | Method and Description |
|---|---|
ZipBuilder |
appendFile(byte[] content,
String... path)
Append a file to the zip content.
|
ZipBuilder |
appendFile(FileContent fileContent,
String... path)
Append a file to the zip content.
|
ZipBuilder |
appendFolder(String... path)
Append a folder to the zip content.
|
byte[] |
toZipBytes()
Build the zip content based on collected folder and files.
|
FileContent |
toZipFileContent()
Build the zip content as
FileContent |
public ZipBuilder(String name)
public ZipBuilder appendFolder(String... path)
path - the path of the folderpublic ZipBuilder appendFile(byte[] content, String... path)
content - the file contentpath - the path of the filepublic ZipBuilder appendFile(FileContent fileContent, String... path)
fileContent - the file contentpath - the folders pathpublic byte[] toZipBytes()
throws IOException
IOException - in case of I/O errorpublic FileContent toZipFileContent() throws IOException
FileContentFileContentIOException - in case of I/O errorCopyright © 2017–2018 Alfresco. All rights reserved.