use of org.nuxeo.ecm.core.api.blobholder.DocumentBlobHolder in project nuxeo-filesystem-connectors by nuxeo.
the class FileResource method get.
@GET
public Object get() {
BlobHolder bh = doc.getAdapter(BlobHolder.class);
Blob blob = bh == null ? null : bh.getBlob();
if (blob == null) {
return Response.ok("").build();
}
String mimeType = blob.getMimeType();
if (mimeType.equals("???")) {
mimeType = "application/octet-stream";
}
// provide full DocumentBlobHolder context if possible, to give more info when calling the DownloadService
Object entity = bh instanceof DocumentBlobHolder ? bh : blob;
return Response.ok(entity).type(mimeType).build();
}
Aggregations