it.remove();
results.addedFromChangeSet(change.getEntry().getName());
}
}
ArchiveEntry entry = null;
while ((entry = in.getNextEntry()) != null) {
boolean copy = true;
for (Iterator<Change> it = workingSet.iterator(); it.hasNext();) {
Change change = it.next();
final int type = change.type();
final String name = entry.getName();
if (type == Change.TYPE_DELETE && name != null) {
if (name.equals(change.targetFile())) {
copy = false;
it.remove();
results.deleted(name);
break;
}
} else if (type == Change.TYPE_DELETE_DIR && name != null) {
// don't combine ifs to make future extensions more easy
if (name.startsWith(change.targetFile() + "/")) { // NOPMD
copy = false;
results.deleted(name);
break;
}
}
}
if (copy
&& !isDeletedLater(workingSet, entry)
&& !results.hasBeenAdded(entry.getName())) {
copyStream(in, out, entry);
results.addedFromStream(entry.getName());
}
}
// Adds files which hasn't been added from the original and do not have replace mode on
for (Iterator<Change> it = workingSet.iterator(); it.hasNext();) {