Merged HEAD (5.2) to 5.2.N (5.2.1)

126382 jkaabimofrad: Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2)
      120441 jvonka: RA-727: REST fwk - fix GET node binary resource (setting of content info response headers)
      - including encoding (Content-Type charset) & locale (Content-Language)


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/DEV/5.2.N/root@126728 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ancuta Morarasu
2016-05-11 10:55:34 +00:00
parent 45945b92a6
commit 3376295913
4 changed files with 58 additions and 33 deletions

View File

@@ -1161,8 +1161,14 @@ public class NodesImpl implements Nodes
throw new InvalidArgumentException("NodeId of content is expected: "+nodeRef);
}
ContentData cd = (ContentData)nodeService.getProperty(nodeRef, ContentModel.PROP_CONTENT);
org.alfresco.rest.framework.resource.content.ContentInfo ci = null;
if (cd != null) {
ci = new org.alfresco.rest.framework.resource.content.ContentInfoImpl(cd.getMimetype(), cd.getEncoding(), cd.getSize(), cd.getLocale());
}
// TODO attachment header - update (or extend ?) REST fwk
return new NodeBinaryResource(nodeRef, ContentModel.PROP_CONTENT);
return new NodeBinaryResource(nodeRef, ContentModel.PROP_CONTENT, ci);
}
@Override