public class AttachmentZipEntryStreamConsumer extends Object implements InputStreamConsumer<io.atlassian.blobstore.client.api.Unit>
InputStreamConsumer
. It will consume inputStream, which have
to provide valid zipStream data and stream content of entry with specified index to provided outputStream.Constructor and Description |
---|
AttachmentZipEntryStreamConsumer(OutputStream outputStream,
Consumer<org.apache.commons.compress.archivers.zip.ZipArchiveEntry> onZipEntryExists,
int entryIndex)
Constructing
AttachmentZipEntryStreamConsumer |
Modifier and Type | Method and Description |
---|---|
io.atlassian.blobstore.client.api.Unit |
withInputStream(InputStream inputStream)
This method will consume inputStream, which have to provide valid zipStream data and stream content of entry with
specified index to provided outputStream.
|
public AttachmentZipEntryStreamConsumer(OutputStream outputStream, Consumer<org.apache.commons.compress.archivers.zip.ZipArchiveEntry> onZipEntryExists, int entryIndex)
AttachmentZipEntryStreamConsumer
outputStream
- outputStream where content of zipEntry will be streamedonZipEntryExists
- consumer which will get called before any data will get streamed into outputStreamentryIndex
- index of zip entry which content will get streamed to outputStream, counting from 0public io.atlassian.blobstore.client.api.Unit withInputStream(InputStream inputStream) throws IOException, ZipEntryNotFoundException
Consumer
onZipEntryExists method will get called
before any bytes gets written to outputStream.withInputStream
in interface InputStreamConsumer<io.atlassian.blobstore.client.api.Unit>
inputStream
- has to provide valid zipStream bytesUnit
ZipEntryNotFoundException
- when entry with given index was not foundIOException
Copyright © 2002-2015 Atlassian. All Rights Reserved.