throw new CmisNotSupportedException("Object can't be checked-out, type is not versionable.");
}
checkIsVersionableObject(so);
VersionedDocument verDoc = getVersionedDocumentOfObjectId(so);
ContentStream content = null;
if (so instanceof DocumentVersion) {
// get document the version is contained in to c
content = ((DocumentVersion) so).getContent(0, -1);
} else {
content = ((VersionedDocument) so).getLatestVersion(false).getContent(0, -1);
}
if (verDoc.isCheckedOut()) {
throw new CmisUpdateConflictException("Document " + objectId.getValue() + " is already checked out.");
}
String user = context.getUsername();
checkHasUser(user);
DocumentVersion pwc = verDoc.checkOut(content, user);
objectId.setValue(pwc.getId()); // return the id of the created pwc
if (null != contentCopied) // Note: always null in AtomPub binding
contentCopied.setValue(true);
// To be able to provide all Atom links in the response we need