Class ChangeSet<E extends ArchiveEntry>
java.lang.Object
org.apache.commons.compress.changes.ChangeSet<E>
- Type Parameters:
E
- The ArchiveEntry type.
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(E entry, InputStream input) Adds a new archive entry to the archive.void
add
(E entry, InputStream input, boolean replace) Adds a new archive entry to the archive.void
Deletes the file with the file name from the archive.void
Deletes the directory tree from the archive.
-
Constructor Details
-
ChangeSet
public ChangeSet()
-
-
Method Details
-
add
Adds a new archive entry to the archive.- Parameters:
entry
- the entry to addinput
- the data stream to add
-
add
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:
entry
- the entry to addinput
- the data stream to addreplace
- indicates the this change should replace existing entries
-
delete
Deletes the file with the file name from the archive.- Parameters:
fileName
- the file name of the file to delete
-
deleteDir
Deletes the directory tree from the archive.- Parameters:
dirName
- the name of the directory tree to delete
-