if (changeToken != null) {
url.addParameter(Constants.PARAM_CHANGE_TOKEN, changeToken.getValue());
}
// set up object and writer
CmisObjectType object = new CmisObjectType();
object.setProperties(convert(properties));
final AtomEntryWriter entryWriter = new AtomEntryWriter(object);
// update
HttpUtils.Response resp = put(url, Constants.MEDIATYPE_ENTRY, new HttpUtils.Output() {
public void write(OutputStream out) throws Exception {
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());
if (changeToken != null) {
changeToken.setValue(null); // just in case
}
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 new change token
if (changeToken != null) {
object = (CmisObjectType) element.getObject();
if (object.getProperties() != null) {
for (CmisProperty property : object.getProperties().getProperty()) {
if (PropertyIds.CHANGE_TOKEN.equals(property.getPropertyDefinitionId())
&& (property instanceof CmisPropertyString)) {
CmisPropertyString changeTokenProperty = (CmisPropertyString) property;
if (!changeTokenProperty.getValue().isEmpty()) {