entryWriter.write(out);
}
});
// parse new entry
AtomEntry entry = parse(resp.getStream(), AtomEntry.class);
// we expect a CMIS entry
if (entry.getId() == null) {
throw new CmisConnectionException("Received Atom entry is not a CMIS entry!");
}
// set object id
objectId.setValue(entry.getId());
Acl originalAces = null;
lockLinks();
try {
// clean up cache
removeLinks(repositoryId, entry.getId());
// walk through the entry
for (AtomElement element : entry.getElements()) {
if (element.getObject() instanceof AtomLink) {
addLink(repositoryId, entry.getId(), (AtomLink) element.getObject());
} else if (element.getObject() instanceof CmisObjectType) {
// extract current ACL
object = (CmisObjectType) element.getObject();
originalAces = convert(object.getAcl(), object.isExactACL());
}
}
} finally {
unlockLinks();
}
// handle ACL modifications
if ((originalAces != null) && (isAclMergeRequired(addAces, removeAces))) {
// merge and update ACL
Acl newACL = mergeAcls(originalAces, addAces, removeAces);
if (newACL != null) {
updateAcl(repositoryId, entry.getId(), newACL, null);
}
}
}