CMIS understands the concept of renditions. Thumbnails and web previews in Alfresco are exposed as CMIS renditions. This blog post gives details. In it, you will see a code example, and I've included it below:
OperationContext context = session.createOperationContext();
context.setRenditionFilterString("cmis:thumbnail");
CmisObject doc = session.getObjectByPath("/Sites/ren/documentLibrary/Spring Surf and OpenCMIS Integration", context);
List<Rendition> renditions = doc.getRenditions();
for (Rendition rendition : renditions)
{
System.out.println("kind: " + rendition.getKind());
System.out.println("mimetype: " + rendition.getMimeType());
System.out.println("width: " + rendition.getWidth());
System.out.println("height: " + rendition.getHeight());
System.out.println("stream id: " + rendition.getStreamId());
}
Note that something that might trip you up is that renditions are not created automatically when objects are added to the repository. Normally, they are created asynchronously when someone requests to see the document library view through the Alfresco Share client.
If you need to be able to create a document and then immediately retrieve its renditions without ever logging in to the Alfresco Share client, you'll need to use rules or behaviors to trigger the creation of the renditions you want.