org.apache.commons.compress.changes
Class ChangeSet

java.lang.Object
  extended by org.apache.commons.compress.changes.ChangeSet

public final class ChangeSet
extends java.lang.Object

ChangeSet collects and performs changes to an archive. Putting delete changes in this ChangeSet from multiple threads can cause conflicts.


Field Summary
private  java.util.Set changes
           
 
Constructor Summary
ChangeSet()
           
 
Method Summary
 void add(ArchiveEntry pEntry, java.io.InputStream pInput)
          Adds a new archive entry to the archive.
 void add(ArchiveEntry pEntry, java.io.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 delete(java.lang.String filename)
          Deletes the file with the filename from the archive.
 void deleteDir(java.lang.String dirName)
          Deletes the directory tree from the archive.
(package private)  java.util.Set getChanges()
          Returns the list of changes as a copy.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

changes

private final java.util.Set changes
Constructor Detail

ChangeSet

public ChangeSet()
Method Detail

delete

public void delete(java.lang.String filename)
Deletes the file with the filename from the archive.

Parameters:
filename - the filename of the file to delete

deleteDir

public void deleteDir(java.lang.String dirName)
Deletes the directory tree from the archive.

Parameters:
dirName - the name of the directory tree to delete

add

public void add(ArchiveEntry pEntry,
                java.io.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,
                java.io.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

addAddition

private void addAddition(Change pChange)
Adds an addition change.

Parameters:
pChange - the change which should result in an addition

addDeletion

private void addDeletion(Change pChange)
Adds an delete change.

Parameters:
pChange - the change which should result in a deletion

getChanges

java.util.Set 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