Package org.codehaus.plexus.archiver.zip
Class ConcurrentJarCreator
java.lang.Object
org.codehaus.plexus.archiver.zip.ConcurrentJarCreator
-
Constructor Summary
ConstructorDescriptionConcurrentJarCreator
(boolean compressAddedZips, int nThreads) Creates a newConcurrentJarCreator
instance.ConcurrentJarCreator
(int nThreads) Creates a newConcurrentJarCreator
instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
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) Returns a message describing the overall statistics of the compression runvoid
writeTo
(org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream targetStream)
-
Constructor Details
-
ConcurrentJarCreator
Creates a newConcurrentJarCreator
instance.ConcurrentJarCreator
creates zip files using several concurrent threads.This constructor has the same effect as
ConcurrentJarCreator(true, nThreads)
- Parameters:
nThreads
- The number of concurrent thread used to create the archive- Throws:
IOException
-
ConcurrentJarCreator
Creates a newConcurrentJarCreator
instance.ConcurrentJarCreator
creates zip files using several concurrent threads. Entries that are already zip file could be just stored or compressed again.- Parameters:
compressAddedZips
- Indicates if entries that are zip files should be compressed. If set tofalse
entries that are zip files will be added usingZipEntry.STORED
method. If set totrue
entries that are zip files will be added using the compression method indicated by theZipArchiveEntry
passed toaddArchiveEntry(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 archive- Throws:
IOException
-
-
Method Details
-
createDeferred
public static org.apache.commons.compress.archivers.zip.ScatterZipOutputStream createDeferred(org.apache.commons.compress.parallel.ScatterGatherBackingStoreSupplier scatterGatherBackingStoreSupplier) throws IOException - Throws:
IOException
-
addArchiveEntry
public void addArchiveEntry(org.apache.commons.compress.archivers.zip.ZipArchiveEntry zipArchiveEntry, org.apache.commons.compress.parallel.InputStreamSupplier source, boolean addInParallel) throws IOException Adds an archive entry to this archive.This method is expected to be called from a single client thread
- Parameters:
zipArchiveEntry
- The entry to add. Compression methodsource
- The source input stream supplieraddInParallel
- Indicates if the entry should be add in parallel. If set tofalse
the entry is added synchronously.- Throws:
IOException
-
writeTo
public void writeTo(org.apache.commons.compress.archivers.zip.ZipArchiveOutputStream targetStream) throws IOException, ExecutionException, InterruptedException -
getStatisticsMessage
Returns a message describing the overall statistics of the compression run- Returns:
- A string
-