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
This commit is contained in:
David Caruana
2010-08-31 11:00:40 +00:00
parent 3a431da024
commit 76ca3e3de6

View File

@@ -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);