Class ChangeSet
java.lang.Object
org.apache.commons.compress.changes.ChangeSet
ChangeSet collects and performs changes to an archive.
Putting delete changes in this ChangeSet from multiple threads can
cause conflicts.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.private void
addAddition
(Change pChange) Adds an addition change.private void
addDeletion
(Change pChange) Adds an delete change.void
Deletes the file with the file name from the archive.void
Deletes the directory tree from the archive.Returns the list of changes as a copy.
-
Field Details
-
changes
-
-
Constructor Details
-
ChangeSet
public ChangeSet()
-
-
Method Details
-
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
-
add
Adds a new archive entry to the archive.- Parameters:
pEntry
- the entry to addpInput
- the datastream 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:
pEntry
- the entry to addpInput
- the datastream to addreplace
- indicates the this change should replace existing entries
-
addAddition
Adds an addition change.- Parameters:
pChange
- the change which should result in an addition
-
addDeletion
Adds an delete change.- Parameters:
pChange
- the change which should result in a deletion
-
getChanges
Returns the list of changes as a copy. Changes on this set are not reflected on this ChangeSet and vice versa.- Returns:
- the changes as a copy
-