mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user