public DavResourceLocator createResourceLocator()

in src/main/java/org/apache/sling/jcr/webdav/impl/helper/SlingLocatorFactory.java [33:65]


    public DavResourceLocator createResourceLocator(String prefix, String href) {

        if (href == null) {
            throw new IllegalArgumentException(
                "Request handle must not be null.");
        }


        // if href starts with the prefix, cut the prefix off the href
        if (prefix != null && prefix.length() > 0) {
            if (href.startsWith(prefix)) {
                href = href.substring(prefix.length());
            }
        }

        // remove trailing "/" that is present with collections
        if (href.endsWith("/")) {
            href = href.substring(0, href.length() - 1);
        }


        // an empty requestHandle (after removal of the "/") signifies a request
        // to the root that does not represent a repository item.
        String resourcePath;
        if ("".equals(href)) {
            resourcePath = "/";
        } else {
            resourcePath = Text.unescape(href);
        }

        return new SlingResourceLocator(prefix, workspaceName, resourcePath,
            this);
    }