public class ChangeSetPerformer
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static interface |
ChangeSetPerformer.ArchiveEntryIterator
Used in perform to abstract out getting entries and streams for
those entries.
|
private static class |
ChangeSetPerformer.ArchiveInputStreamIterator |
private static class |
ChangeSetPerformer.ZipFileIterator |
Constructor and Description |
---|
ChangeSetPerformer(ChangeSet changeSet)
Constructs a ChangeSetPerformer with the changes from this ChangeSet
|
Modifier and Type | Method and Description |
---|---|
private void |
copyStream(java.io.InputStream in,
ArchiveOutputStream out,
ArchiveEntry entry)
Copies the ArchiveEntry to the Output stream
|
private boolean |
isDeletedLater(java.util.Set<Change> workingSet,
ArchiveEntry entry)
Checks if an ArchiveEntry is deleted later in the ChangeSet.
|
ChangeSetResults |
perform(ArchiveInputStream in,
ArchiveOutputStream out)
Performs all changes collected in this ChangeSet on the input stream and
streams the result to the output stream.
|
private ChangeSetResults |
perform(ChangeSetPerformer.ArchiveEntryIterator entryIterator,
ArchiveOutputStream out)
Performs all changes collected in this ChangeSet on the input entries and
streams the result to the output stream.
|
ChangeSetResults |
perform(ZipFile in,
ArchiveOutputStream out)
Performs all changes collected in this ChangeSet on the ZipFile and
streams the result to the output stream.
|
private final java.util.Set<Change> changes
public ChangeSetPerformer(ChangeSet changeSet)
changeSet
- the ChangeSet which operations are used for performingpublic ChangeSetResults perform(ArchiveInputStream in, ArchiveOutputStream out) throws java.io.IOException
in
- the InputStream to perform the changes onout
- the resulting OutputStream with all modificationsjava.io.IOException
- if an read/write error occurspublic ChangeSetResults perform(ZipFile in, ArchiveOutputStream out) throws java.io.IOException
in
- the ZipFile to perform the changes onout
- the resulting OutputStream with all modificationsjava.io.IOException
- if an read/write error occursprivate ChangeSetResults perform(ChangeSetPerformer.ArchiveEntryIterator entryIterator, ArchiveOutputStream out) throws java.io.IOException
entryIterator
- the entries to perform the changes onout
- the resulting OutputStream with all modificationsjava.io.IOException
- if an read/write error occursprivate boolean isDeletedLater(java.util.Set<Change> workingSet, ArchiveEntry entry)
entry
- the entry to checkprivate void copyStream(java.io.InputStream in, ArchiveOutputStream out, ArchiveEntry entry) throws java.io.IOException
in
- the stream to read the data fromout
- the stream to write the data toentry
- the entry to writejava.io.IOException
- if data cannot be read or written