org.apache.commons.compress.changes

## Class ChangeSet

- java.lang.Object
- - org.apache.commons.compress.changes.ChangeSet

-     public final class ChangeSet
      extends Object

  ChangeSet collects and performs changes to an archive. Putting delete changes in this ChangeSet from multiple threads can cause conflicts.
  This class is not thread-safe

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ChangeSet()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(ArchiveEntry pEntry, InputStream pInput)` Adds a new archive entry to the archive.
    `void` | `add(ArchiveEntry pEntry, InputStream pInput, boolean replace)` Adds a new archive entry to the archive.
    `void` | `delete(String fileName)` Deletes the file with the file name from the archive.
    `void` | `deleteDir(String dirName)` Deletes the directory tree from the archive.

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

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

- - ### Constructor Detail

    - #### ChangeSet

          public ChangeSet()

  - ### Method Detail

    - #### add

          public void add(ArchiveEntry pEntry,
                          InputStream pInput)

      Adds a new archive entry to the archive.
      Parameters:
        `pEntry` - the entry to add
        `pInput` - the datastream to add

    - #### add

          public void add(ArchiveEntry pEntry,
                          InputStream pInput,
                          boolean replace)

      Adds a new archive entry to the archive. If replace is set to true, this change will replace all other additions done in this ChangeSet and all existing entries in the original stream.
      Parameters:
        `pEntry` - the entry to add
        `pInput` - the datastream to add
        `replace` - indicates the this change should replace existing entries

    - #### delete

          public void delete(String fileName)

      Deletes the file with the file name from the archive.
      Parameters:
        `fileName` - the file name of the file to delete

    - #### deleteDir

          public void deleteDir(String dirName)

      Deletes the directory tree from the archive.
      Parameters:
        `dirName` - the name of the directory tree to delete

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