. Fix to WebDav name based path resolving util method

- now correctly handles Company Home root case

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@4506 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-12-04 11:39:37 +00:00
parent f06cb6ac6e
commit e57a636bc3

View File

@@ -244,7 +244,7 @@ public abstract class BaseServlet extends HttpServlet
{ {
NodeRef nodeRef = null; NodeRef nodeRef = null;
List<String> paths = new ArrayList<String>(args.length-1); List<String> paths = new ArrayList<String>(args.length - 1);
FileInfo file = null; FileInfo file = null;
try try
@@ -259,12 +259,14 @@ public abstract class BaseServlet extends HttpServlet
logger.debug("Attempting to resolve webdav path: " + paths); logger.debug("Attempting to resolve webdav path: " + paths);
// get the company home node to start the search from // get the company home node to start the search from
NodeRef companyHome = new NodeRef(Repository.getStoreRef(), nodeRef = new NodeRef(Repository.getStoreRef(), Application.getCompanyRootId());
Application.getCompanyRootId());
FileFolderService ffs = (FileFolderService)wc.getBean("FileFolderService"); if (paths.size() != 0)
file = ffs.resolveNamePath(companyHome, paths); {
nodeRef = file.getNodeRef(); FileFolderService ffs = (FileFolderService)wc.getBean("FileFolderService");
file = ffs.resolveNamePath(nodeRef, paths);
nodeRef = file.getNodeRef();
}
if (logger.isDebugEnabled()) if (logger.isDebugEnabled())
logger.debug("Resolved webdav path to NodeRef: " + nodeRef); logger.debug("Resolved webdav path to NodeRef: " + nodeRef);