/** * Creates a new {@code ConcurrentJarCreator} instance. * <p> * {@code ConcurrentJarCreator} creates zip files using several concurrent threads. * Entries that are already zip file could be just stored or compressed again.</p> * * @param compressAddedZips Indicates if entries that are zip files should be compressed. * If set to {@code false} entries that are zip files will be added using * {@link ZipEntry#STORED} method. * If set to {@code true} entries that are zip files will be added using * the compression method indicated by the {@code ZipArchiveEntry} passed * to {@link #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 parameter * @param nThreads The number of concurrent thread used to create the archive * * @throws IOException */ public ConcurrentJarCreator( boolean compressAddedZips, int nThreads ) throws IOException { this.compressAddedZips = compressAddedZips; ScatterGatherBackingStoreSupplier defaultSupplier = new DeferredSupplier( 100000000 / nThreads ); directories = createDeferred( defaultSupplier ); manifest = createDeferred( defaultSupplier ); metaInfDir = createDeferred( defaultSupplier ); synchronousEntries = createDeferred( defaultSupplier ); parallelScatterZipCreator = new ParallelScatterZipCreator( Executors.newFixedThreadPool( nThreads ), defaultSupplier ); }
scatterZipCreator = new ParallelScatterZipCreator(Executors.newFixedThreadPool(numConnections)); } catch (NoSuchAlgorithmException | KeyManagementException e) { logger.warning("Aint gonna work");