Calling Blob#getMimeType on blob returned by the following code always returns application/octet-stream:
Document file = nuxeoClient.repository().fetchDocumentByPath(pathOrId); Blob blob = file.fetchBlob(); System.out.println("Mimetype: " + blob.getMimeType());