if (owner.equals(getOwnerOfFile(new File(file, addedFileName)))) {
incrementBySameOwner.add(addedFileName);
}
}
addedFiles.removeAll(incrementBySameOwner);
Author ownerAuthor = authorManager.getAuthor(owner);
if (ownerAuthor == null) {
ownerAuthor = authorManager.createAuthor(owner);
authorManager.storeAuthor(ownerAuthor);
authorManager.commit();
}
if (revision > 1) {
repository.getArtifact(new ArtifactIdentifier(printPath, revision - 1, "")).setObsoleteDate(newRevisionDate);
}
repository.addArtifact(new ArtifactIdentifier(printPath, revision, ""),
newRevisionDate,
contentFromSetOfFileNames(incrementBySameOwner),
ownerAuthor);
repository.commit();
revision++;
}
// => remove directory names from artifact in repository
Set<String> removedFiles = new TreeSet<String>(filesInOldVersion);
removedFiles.removeAll(filesInNewVersion);
if (removedFiles.size() > 0) {
logger.debug("Files were removed from " + printPath + ": " + removedFiles);
Author authorWhoDeleted;
if (owner != null) {
// we don't know who removed the files but let's guess it was one of those who also added files, otherwise assume it was the owner of the directory himself
authorWhoDeleted = authorManager.getAuthor(owner);
} else {
owner = getOwnerOfFile(file);