Top Description Fields Constructors Methods
org.apache.commons.compress.changes

public final Class ChangeSet<E extends org.apache.commons.compress.archivers.ArchiveEntry>

extends Object
Class Inheritance
Type Parameters
<E>
The ArchiveEntry type.
Imports
java.io.InputStream, java.util.Iterator, .LinkedHashSet, .Set, java.util.regex.Pattern, org.apache.commons.compress.archivers.ArchiveEntry, org.apache.commons.compress.changes.Change.ChangeType

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

Field Summary

Modifier and TypeField and Description
private final Set<Change<E>>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
add(final E
the entry to add
entry
,
final InputStream
the data stream to add
input
)

Adds a new archive entry to the archive.

public void
add(final E
the entry to add
entry
,
final InputStream
the data stream to add
input
,
final boolean
indicates the this change should replace existing entries
replace
)

Adds a new archive entry to the archive.

private void
addAddition(final Change<E>
the change which should result in an addition
addChange
)

Adds an addition change.

private void
addDeletion(final Change<E>
the change which should result in a deletion
deleteChange
)

Adds an delete change.

public void
delete(final String
the file name of the file to delete
fileName
)

Deletes the file with the file name from the archive.

public void
deleteDir(final String
the name of the directory tree to delete
dirName
)

Deletes the directory tree from the archive.

pack-priv Set<Change<E>>

Returns:

the changes as a copy
getChanges
()

Gets the list of changes as a copy.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

changesback to summary
private final Set<Change<E>> changes

Constructor Detail

ChangeSetback to summary
public ChangeSet()

Method Detail

addback to summary
public void add(final E entry, final InputStream input)

Adds a new archive entry to the archive.

Parameters
entry:E

the entry to add

input:InputStream

the data stream to add

addback to summary
public void add(final E entry, final InputStream input, final 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
entry:E

the entry to add

input:InputStream

the data stream to add

replace:boolean

indicates the this change should replace existing entries

addAdditionback to summary
private void addAddition(final Change<E> addChange)

Adds an addition change.

Parameters
addChange:Change<E>

the change which should result in an addition

Annotations
@SuppressWarnings:resource
addDeletionback to summary
private void addDeletion(final Change<E> deleteChange)

Adds an delete change.

Parameters
deleteChange:Change<E>

the change which should result in a deletion

deleteback to summary
public void delete(final String fileName)

Deletes the file with the file name from the archive.

Parameters
fileName:String

the file name of the file to delete

deleteDirback to summary
public void deleteDir(final String dirName)

Deletes the directory tree from the archive.

Parameters
dirName:String

the name of the directory tree to delete

getChangesback to summary
pack-priv Set<Change<E>> getChanges()

Gets the list of changes as a copy. Changes on this set are not reflected on this ChangeSet and vice versa.

Returns:Set<Change<E>>

the changes as a copy