code: protected String makeRESTPath(String repoName, String workspace, String resource)
     {
        final StringBuilder sb = new StringBuilder(512);
        ExoContainer container = ExoContainerContext.getCurrentContainerIfPresent();
        if (container instanceof PortalContainer)
        {
           PortalContainer pContainer = (PortalContainer)container;
           sb.append('/').append(pContainer.getRestContextName()).append('/');
        }
        else
        {
           sb.append('/').append(PortalContainer.DEFAULT_REST_CONTEXT_NAME).append('/');
        }
        return sb.append("jcr/").append(repoName).append('/').append(workspace).append(resource).toString();
     }
docs: Compile REST path of the given resource.
  
  @param workspace
  @param resource
  , we assume that path starts with '/'
  @return