public static String getEffectivePath()

in src/main/java/org/apache/sling/jcr/jackrabbit/accessmanager/impl/PrincipalAceHelper.java [45:74]


    public static String getEffectivePath(SlingHttpServletRequest request) {
        String effectivePath = request.getResource().getPath();
        if (ResourceUtil.isNonExistingResource(request.getResource())) {
            // for non-existing resource trim the selectors and extension 
            //   off the resource path
            @NotNull
            RequestPathInfo requestPathInfo = request.getRequestPathInfo();
            @NotNull
            String resourcePath = requestPathInfo.getResourcePath();
            //trim the selectors and extension off the resource path
            @Nullable
            String extension = requestPathInfo.getExtension();
            if (extension != null) {
                resourcePath = resourcePath.substring(0, resourcePath.length() - extension.length() - 1);
            }
            @Nullable
            String selectorString = requestPathInfo.getSelectorString();
            if (selectorString != null) {
                resourcePath = resourcePath.substring(0, resourcePath.length() - selectorString.length() - 1);
            }

            if (PrincipalAceHelper.RESOURCE_PATH_REPOSITORY.equals(resourcePath)) {
                // special case
                effectivePath = null;
            } else {
                effectivePath = resourcePath;
            }
        }
        return effectivePath;
    }