Class ZipArchiveEntryRequest
- java.lang.Object
-
- org.apache.commons.compress.archivers.zip.ZipArchiveEntryRequest
-
public class ZipArchiveEntryRequest extends java.lang.ObjectA Thread-safe representation of a ZipArchiveEntry that is used to add entries to parallel archives.- Since:
- 1.10
-
-
Field Summary
Fields Modifier and Type Field Description private intmethodprivate InputStreamSupplierpayloadSupplierprivate ZipArchiveEntryzipArchiveEntryThe ZIPArchiveEntry is not thread safe, and cannot be safely accessed by the getters of this class.
-
Constructor Summary
Constructors Modifier Constructor Description privateZipArchiveEntryRequest(ZipArchiveEntry zipArchiveEntry, InputStreamSupplier payloadSupplier)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ZipArchiveEntryRequestcreateZipArchiveEntryRequest(ZipArchiveEntry zipArchiveEntry, InputStreamSupplier payloadSupplier)Creates a ZipArchiveEntryRequestintgetMethod()Gets the compression method to usejava.io.InputStreamgetPayloadStream()Gets the payload that will be added to this ZIP entry(package private) ZipArchiveEntrygetZipArchiveEntry()Gets the underlying entry.
-
-
-
Field Detail
-
zipArchiveEntry
private final ZipArchiveEntry zipArchiveEntry
The ZIPArchiveEntry is not thread safe, and cannot be safely accessed by the getters of this class. It is safely accessible during the construction part of this class and also after the thread pools have been shut down.
-
payloadSupplier
private final InputStreamSupplier payloadSupplier
-
method
private final int method
-
-
Constructor Detail
-
ZipArchiveEntryRequest
private ZipArchiveEntryRequest(ZipArchiveEntry zipArchiveEntry, InputStreamSupplier payloadSupplier)
-
-
Method Detail
-
createZipArchiveEntryRequest
public static ZipArchiveEntryRequest createZipArchiveEntryRequest(ZipArchiveEntry zipArchiveEntry, InputStreamSupplier payloadSupplier)
Creates a ZipArchiveEntryRequest- Parameters:
zipArchiveEntry- The entry to usepayloadSupplier- The payload that will be added to the ZIP entry.- Returns:
- The newly created request
-
getMethod
public int getMethod()
Gets the compression method to use- Returns:
- The compression method to use
-
getPayloadStream
public java.io.InputStream getPayloadStream()
Gets the payload that will be added to this ZIP entry- Returns:
- The input stream.
-
getZipArchiveEntry
ZipArchiveEntry getZipArchiveEntry()
Gets the underlying entry. Do not use this method from threads that did not create the instance itself !- Returns:
- the zipArchiveEntry that is basis for this request
-
-