public class

AttachmentZipEntryStreamConsumer

extends Object
implements InputStreamConsumer<T>
java.lang.Object
   ↳ com.atlassian.jira.issue.attachment.zip.AttachmentZipEntryStreamConsumer

Class Overview

This class implements InputStreamConsumer. It will consume inputStream, which have to provide valid zipStream data and stream content of entry with specified index to provided outputStream.

Summary

Public Constructors
AttachmentZipEntryStreamConsumer(OutputStream outputStream, Consumer<ZipArchiveEntry> onZipEntryExists, int entryIndex)
Public Methods
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.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.util.io.InputStreamConsumer

Public Constructors

public AttachmentZipEntryStreamConsumer (OutputStream outputStream, Consumer<ZipArchiveEntry> onZipEntryExists, int entryIndex)

Parameters
outputStream outputStream where content of zipEntry will be streamed
onZipEntryExists consumer which will get called before any data will get streamed into outputStream
entryIndex index of zip entry which content will get streamed to outputStream, counting from 0

Public Methods

public 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. Callback Consumer onZipEntryExists method will get called before any bytes gets written to outputStream.

Parameters
inputStream has to provide valid zipStream bytes
Returns
  • io.atlassian.blobstore.client.api.Unit
Throws
ZipEntryNotFoundException when entry with given index was not found
IOException