public class ConcurrentJarCreator extends Object
Constructor and Description |
---|
ConcurrentJarCreator(boolean compressAddedZips,
int nThreads)
Creates a new
ConcurrentJarCreator instance. |
ConcurrentJarCreator(int nThreads)
Creates a new
ConcurrentJarCreator instance. |
Modifier and Type | Method and Description |
---|---|
void |
addArchiveEntry(org.apache.commons.compress.archivers.zip.ZipArchiveEntry zipArchiveEntry,
org.apache.commons.compress.parallel.InputStreamSupplier source,
boolean addInParallel)
Adds an archive entry to this archive.
|
static org.apache.commons.compress.archivers.zip.ScatterZipOutputStream |
createDeferred(org.apache.commons.compress.parallel.ScatterGatherBackingStoreSupplier scatterGatherBackingStoreSupplier) |
String |
getStatisticsMessage()
Returns a message describing the overall statistics of the compression run
|
void |
writeTo(org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream targetStream) |
public ConcurrentJarCreator(int nThreads) throws IOException
ConcurrentJarCreator
instance.
ConcurrentJarCreator
creates zip files using several concurrent threads.
This constructor has the same effect as
ConcurrentJarCreator(true, nThreads)
nThreads
- The number of concurrent thread used to create the archiveIOException
public ConcurrentJarCreator(boolean compressAddedZips, int nThreads) throws IOException
ConcurrentJarCreator
instance.
ConcurrentJarCreator
creates zip files using several concurrent threads.
Entries that are already zip file could be just stored or compressed again.
compressAddedZips
- Indicates if entries that are zip files should be compressed.
If set to false
entries that are zip files will be added using
ZipEntry.STORED
method.
If set to true
entries that are zip files will be added using
the compression method indicated by the ZipArchiveEntry
passed
to addArchiveEntry(ZipArchiveEntry, InputStreamSupplier, boolean)
.
The compression method for all entries that are not zip files will not be changed
regardless of the value of this parameternThreads
- The number of concurrent thread used to create the archiveIOException
public static org.apache.commons.compress.archivers.zip.ScatterZipOutputStream createDeferred(org.apache.commons.compress.parallel.ScatterGatherBackingStoreSupplier scatterGatherBackingStoreSupplier) throws IOException
IOException
public void addArchiveEntry(org.apache.commons.compress.archivers.zip.ZipArchiveEntry zipArchiveEntry, org.apache.commons.compress.parallel.InputStreamSupplier source, boolean addInParallel) throws IOException
This method is expected to be called from a single client thread
zipArchiveEntry
- The entry to add. Compression methodsource
- The source input stream supplieraddInParallel
- Indicates if the entry should be add in parallel.
If set to false
the entry is added synchronously.IOException
public void writeTo(org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream targetStream) throws IOException, ExecutionException, InterruptedException
public String getStatisticsMessage()
Copyright © 2001–2021 Codehaus Plexus. All rights reserved.