1717 */
1818package org .codehaus .plexus .archiver .zip ;
1919
20- import org .apache .commons .compress .archivers .zip .*;
20+ import org .apache .commons .compress .archivers .zip .ParallelScatterZipCreator ;
21+ import org .apache .commons .compress .archivers .zip .ScatterZipOutputStream ;
22+ import org .apache .commons .compress .archivers .zip .StreamCompressor ;
23+ import org .apache .commons .compress .archivers .zip .ZipArchiveEntry ;
24+ import org .apache .commons .compress .archivers .zip .ZipArchiveOutputStream ;
2125import org .apache .commons .compress .parallel .InputStreamSupplier ;
2226import org .apache .commons .compress .parallel .ScatterGatherBackingStore ;
2327import org .apache .commons .compress .parallel .ScatterGatherBackingStoreSupplier ;
@@ -42,10 +46,20 @@ public class ConcurrentJarCreator {
4246 private final ParallelScatterZipCreator parallelScatterZipCreator ;
4347 private long zipCloseElapsed ;
4448
45- static class DeferredSupplier implements ScatterGatherBackingStoreSupplier
49+ private static class DeferredSupplier
50+ implements ScatterGatherBackingStoreSupplier
4651 {
47- public ScatterGatherBackingStore get () throws IOException {
48- return new DeferredScatterOutputStream ();
52+ private int threshold ;
53+
54+ DeferredSupplier ( int threshold )
55+ {
56+ this .threshold = threshold ;
57+ }
58+
59+ public ScatterGatherBackingStore get ()
60+ throws IOException
61+ {
62+ return new DeferredScatterOutputStream ( threshold );
4963 }
5064 }
5165
@@ -57,7 +71,7 @@ public static ScatterZipOutputStream createDeferred(ScatterGatherBackingStoreSup
5771 }
5872
5973 public ConcurrentJarCreator (int nThreads ) throws IOException {
60- ScatterGatherBackingStoreSupplier defaultSupplier = new DeferredSupplier ();
74+ ScatterGatherBackingStoreSupplier defaultSupplier = new DeferredSupplier (100000000 / nThreads );
6175
6276 directories = createDeferred (defaultSupplier );
6377 manifest = createDeferred (defaultSupplier );
0 commit comments