Package pl.wrzasq.lambda.edgedeploy.zip
Class ZipBuilder
- java.lang.Object
-
- pl.wrzasq.lambda.edgedeploy.zip.ZipBuilder
-
public class ZipBuilder extends Object
Utility class for building ZIP archive stream.
-
-
Constructor Summary
Constructors Constructor Description ZipBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcopyFrom(ZipInputStream archive)Copies another archive into current one.ByteBufferdump()Closes active stream.voidwriteEntry(String name, byte[] content)Creates new ZIP archive entry.voidwriteEntry(String name, InputStream stream)Creates new ZIP archive entry.
-
-
-
Method Detail
-
writeEntry
public void writeEntry(String name, byte[] content) throws IOException
Creates new ZIP archive entry.- Parameters:
name- Entry stackSetName.content- Binary content of the file.- Throws:
IOException- When writing content to archive fails.
-
writeEntry
public void writeEntry(String name, InputStream stream) throws IOException
Creates new ZIP archive entry.- Parameters:
name- Entry stackSetName.stream- Content source.- Throws:
IOException- When writing content to archive fails.
-
copyFrom
public void copyFrom(ZipInputStream archive) throws IOException
Copies another archive into current one.- Parameters:
archive- Source.- Throws:
IOException- When reading source archive fails.
-
dump
public ByteBuffer dump() throws IOException
Closes active stream.- Returns:
- Archive binary content.
- Throws:
IOException- When dumping ZIP stream fails.
-
-