org.apache.commons.compress.archivers.zip

## Class DefaultBackingStoreSupplier

- java.lang.Object
- - org.apache.commons.compress.archivers.zip.DefaultBackingStoreSupplier

- All Implemented Interfaces:
    ScatterGatherBackingStoreSupplier

      public class DefaultBackingStoreSupplier
      extends Object
      implements 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

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultBackingStoreSupplier(Path dir)` Constructs a new instance.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `ScatterGatherBackingStore` | `get()` Create a ScatterGatherBackingStore.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DefaultBackingStoreSupplier

          public DefaultBackingStoreSupplier(Path dir)

      Constructs a new instance. If `dir` is null, then use the default temporary-file directory.
      Parameters:
        `dir` - temporary folder, may be null, must exist if non-null.

  - ### Method Detail

    - #### get

          public ScatterGatherBackingStore get()
                                        throws IOException

      Description copied from interface: `ScatterGatherBackingStoreSupplier`
      Create a ScatterGatherBackingStore.
      Specified by:
        `get` in interface `ScatterGatherBackingStoreSupplier`
      Returns:
        a ScatterGatherBackingStore, not null
      Throws:
        `IOException` - when something fails

Copyright © 2002–2022 The Apache Software Foundation. All rights reserved.