addResult(createResult(SKIPPED,
"A content stream is required for this docuemnt type. deleteContentStream() test skipped!"));
} else {
// delete content stream
try {
ObjectId newObjectId = workDoc.deleteContentStream(true);
// deleteContentStream may have created a new version
Document contentDoc = getNewVersion(session, workDoc, checkedout, newObjectId,
"deleteContentStream()");
f = createResult(FAILURE, "Document still has content after deleteContentStream() has been called!");
addResult(assertNull(contentDoc.getContentStream(), null, f));
workDoc = contentDoc;
} catch (CmisNotSupportedException e) {
addResult(createResult(WARNING, "deleteContentStream() is not supported!"));
}
}
// set a new content stream
byte[] contentBytes = new byte[0];
try {
contentBytes = CONTENT2.getBytes("UTF-8");
} catch (Exception e) {
}
ContentStream contentStream = new ContentStreamImpl(workDoc.getName(),
BigInteger.valueOf(contentBytes.length), "text/plain", new ByteArrayInputStream(contentBytes));
ObjectId newObjectId = workDoc.setContentStream(contentStream, true, true);
// setContentStream may have created a new version
Document contentDoc = getNewVersion(session, workDoc, checkedout, newObjectId, "setContentStream()");
// test new content