/**
* Returns the main blob for the given {@code doc}, {@code null} if there is
* no main file available.
*/
public Blob getAttachment(DocumentModel doc) throws ClientException {
BlobHolder bh = doc.getAdapter(BlobHolder.class);
return bh != null ? bh.getBlob() : null;
}