From 0541849643d912f161a3bd5faed547761e9d277f Mon Sep 17 00:00:00 2001 From: Jamal Kaabi-Mofrad Date: Tue, 10 May 2016 11:36:40 +0000 Subject: [PATCH] Merged FILE-FOLDER-API (5.2.0) to HEAD (5.2) 124672 jkaabimofrad: Added check for spring bean DI (as before it caused SFS cloud to fail when downloading or creating docs as we are extending the NodesImpl in the cloud overlay). Also, minor fixes to NodesImpl. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@126575 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- source/java/org/alfresco/rest/api/impl/NodesImpl.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/source/java/org/alfresco/rest/api/impl/NodesImpl.java b/source/java/org/alfresco/rest/api/impl/NodesImpl.java index 82bf4ff435..92c391bd5a 100644 --- a/source/java/org/alfresco/rest/api/impl/NodesImpl.java +++ b/source/java/org/alfresco/rest/api/impl/NodesImpl.java @@ -132,6 +132,7 @@ import org.alfresco.service.cmr.version.VersionType; import org.alfresco.service.namespace.NamespaceService; import org.alfresco.service.namespace.QName; import org.alfresco.util.Pair; +import org.alfresco.util.PropertyCheck; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -203,7 +204,7 @@ public class NodesImpl implements Nodes // ignore types/aspects private Set ignoreQNames; - private ConcurrentHashMap ddCache = new ConcurrentHashMap(); + private ConcurrentHashMap ddCache = new ConcurrentHashMap<>(); private Set nonAttachContentTypes = Collections.emptySet(); // pre-configured whitelist, eg. images & pdf @@ -214,6 +215,12 @@ public class NodesImpl implements Nodes public void init() { + PropertyCheck.mandatory(this, "serviceRegistry", sr); + PropertyCheck.mandatory(this, "behaviourFilter", behaviourFilter); + PropertyCheck.mandatory(this, "repositoryHelper", repositoryHelper); + PropertyCheck.mandatory(this, "quickShareLinks", quickShareLinks); + PropertyCheck.mandatory(this, "poster", poster); + this.namespaceService = sr.getNamespaceService(); this.fileFolderService = sr.getFileFolderService(); this.nodeService = sr.getNodeService(); @@ -1491,7 +1498,7 @@ public class NodesImpl implements Nodes // Checks for the presence of, and creates as necessary, // the folder structure in the provided path elements list. - if (pathElements != null && !pathElements.isEmpty()) + if (!pathElements.isEmpty()) { parentNodeRef = makeFolders(parentNodeRef, pathElements); }