17
17
*/
18
18
package org .codehaus .plexus .archiver .zip ;
19
19
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 ;
21
25
import org .apache .commons .compress .parallel .InputStreamSupplier ;
22
26
import org .apache .commons .compress .parallel .ScatterGatherBackingStore ;
23
27
import org .apache .commons .compress .parallel .ScatterGatherBackingStoreSupplier ;
@@ -42,10 +46,20 @@ public class ConcurrentJarCreator {
42
46
private final ParallelScatterZipCreator parallelScatterZipCreator ;
43
47
private long zipCloseElapsed ;
44
48
45
- static class DeferredSupplier implements ScatterGatherBackingStoreSupplier
49
+ private static class DeferredSupplier
50
+ implements ScatterGatherBackingStoreSupplier
46
51
{
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 );
49
63
}
50
64
}
51
65
@@ -57,7 +71,7 @@ public static ScatterZipOutputStream createDeferred(ScatterGatherBackingStoreSup
57
71
}
58
72
59
73
public ConcurrentJarCreator (int nThreads ) throws IOException {
60
- ScatterGatherBackingStoreSupplier defaultSupplier = new DeferredSupplier ();
74
+ ScatterGatherBackingStoreSupplier defaultSupplier = new DeferredSupplier (100000000 / nThreads );
61
75
62
76
directories = createDeferred (defaultSupplier );
63
77
manifest = createDeferred (defaultSupplier );
0 commit comments