From 76ca3e3de6076c3b25628c0bb4f30f08259c97d4 Mon Sep 17 00:00:00 2001 From: David Caruana Date: Tue, 31 Aug 2010 11:00:40 +0000 Subject: [PATCH] Resolve ALF-4522: Accessing document via /alfresco/service/api/path doesn't work - "Company Home" token is duplicated git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22073 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261 --- .../org/alfresco/repo/cmis/reference/ObjectPathReference.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/java/org/alfresco/repo/cmis/reference/ObjectPathReference.java b/source/java/org/alfresco/repo/cmis/reference/ObjectPathReference.java index cced706acd..2f51574fd5 100644 --- a/source/java/org/alfresco/repo/cmis/reference/ObjectPathReference.java +++ b/source/java/org/alfresco/repo/cmis/reference/ObjectPathReference.java @@ -45,7 +45,8 @@ public class ObjectPathReference extends AbstractObjectReference { super(cmisServices, repo); this.path = path.startsWith("/") ? path : "/" + path; - this.path = (!cmisServices.getDefaultRootPath().equals("/")) ? cmisServices.getDefaultRootPath() + this.path : this.path; + this.path = (cmisServices.getDefaultRootPath().equals("/") || this.path.startsWith(cmisServices.getDefaultRootPath())) ? + this.path : cmisServices.getDefaultRootPath() + this.path; String[] splitPath = this.path.split("/"); String[] pathSegments = new String[splitPath.length -1]; System.arraycopy(splitPath, 1, pathSegments, 0, splitPath.length -1);