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

129159 mmuller: Merged RETURN-OF-THE-API (5.2.0) to 5.2.N (5.2.1)
      128442 jvonka: V1 REST API: Update binary content - add optional name param (to allow rename on upload of a new version)
      - api implementation + api sanity tests (+ve/-ve)
      REPO-518


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@129333 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alexandru Epure
2016-08-09 14:11:25 +00:00
parent 229b617556
commit 6e49b00e89
4 changed files with 71 additions and 13 deletions

View File

@@ -2254,7 +2254,17 @@ public class NodesImpl implements Nodes
}
String versionComment = parameters.getParameter(PARAM_VERSION_COMMENT);
final String fileName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
String fileName = parameters.getParameter(PARAM_NAME);
if (fileName != null)
{
// optionally rename, before updating the content
nodeService.setProperty(nodeRef, ContentModel.PROP_NAME, fileName);
}
else
{
fileName = (String)nodeService.getProperty(nodeRef, ContentModel.PROP_NAME);
}
return updateExistingFile(null, nodeRef, fileName, contentInfo, stream, parameters, versionMajor, versionComment);
}