Top Description Fields Constructors Methods
org.apache.commons.compress.archivers.zip

public Class DefaultBackingStoreSupplier

extends Object
implements ScatterGatherBackingStoreSupplier
Class Inheritance
All Implemented Interfaces
org.apache.commons.compress.parallel.ScatterGatherBackingStoreSupplier
Imports
java.io.IOException, java.nio.file.Files, .Path, java.util.concurrent.atomic.AtomicInteger, org.apache.commons.compress.parallel.FileBasedScatterGatherBackingStore, .ScatterGatherBackingStore, .ScatterGatherBackingStoreSupplier

Implements ScatterGatherBackingStoreSupplier using a temporary folder.

For example:

final Path dir = Paths.get("target/custom-temp-dir");
Files.createDirectories(dir);
final ParallelScatterZipCreator zipCreator = new ParallelScatterZipCreator(Executors.newFixedThreadPool(Runtime.getRuntime().availableProcessors()),
        new DefaultBackingStoreSupplier(dir));
Since
1.23

Field Summary

Modifier and TypeField and Description
private final Path
private static final String
private final AtomicInteger

Constructor Summary

AccessConstructor and Description
public
DefaultBackingStoreSupplier(final Path
temporary folder, may be null, must exist if non-null.
dir
)

Constructs a new instance.

Method Summary

Modifier and TypeMethod and Description
public ScatterGatherBackingStore
get()

Implements org.apache.commons.compress.parallel.ScatterGatherBackingStoreSupplier.get.

Constructs a ScatterGatherBackingStore.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dirback to summary
private final Path dir
PREFIXback to summary
private static final String PREFIX
storeNumback to summary
private final AtomicInteger storeNum

Constructor Detail

DefaultBackingStoreSupplierback to summary
public DefaultBackingStoreSupplier(final Path dir)

Constructs a new instance. If dir is null, then use the default temporary-file directory.

Parameters
dir:Path

temporary folder, may be null, must exist if non-null.

Method Detail

getback to summary
public ScatterGatherBackingStore get() throws IOException

Implements org.apache.commons.compress.parallel.ScatterGatherBackingStoreSupplier.get.

Doc from org.apache.commons.compress.parallel.ScatterGatherBackingStoreSupplier.get.

Constructs a ScatterGatherBackingStore.

Returns:ScatterGatherBackingStore

a ScatterGatherBackingStore, not null

Annotations
@Override
Exceptions
IOException:
when something fails