src/main/java/org/apache/sling/api/uri/SlingUriBuilder.java [162:192]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        @NotNull ResourceResolver resourceResolver = request.getResourceResolver();
        @NotNull
        SlingUriBuilder uriBuilder = createFrom(request.getRequestPathInfo())
                .setResourceResolver(resourceResolver)
                .setScheme(request.getScheme())
                .setHost(request.getServerName())
                .setPort(request.getServerPort())
                .setQuery(request.getQueryString());

        // SLING-11347 - check if the original request was using a mapped path
        @Nullable String resourcePath = uriBuilder.getResourcePath();
        if (resourcePath != null) {
            @NotNull String mappedResourcePath = resourceResolver.map(request, resourcePath);
            if (!resourcePath.equals(mappedResourcePath)
                    && request.getPathInfo().startsWith(mappedResourcePath)) {
                // mapped path is different from the resource path and
                // the request path was the mapped path, so switch to it
                uriBuilder.setResourcePath(mappedResourcePath);
            }
        }
        return uriBuilder;
    }

    /**
     * Creates a builder from a request.
     *
     * @param request request to take the URI information from
     * @return a SlingUriBuilder
     * @since 1.4.0
     */
    @NotNull
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



src/main/java/org/apache/sling/api/uri/SlingUriBuilder.java [194:225]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        @NotNull ResourceResolver resourceResolver = request.getResourceResolver();
        @NotNull
        SlingUriBuilder uriBuilder = createFrom(request.getRequestPathInfo())
                .setResourceResolver(resourceResolver)
                .setScheme(request.getScheme())
                .setHost(request.getServerName())
                .setPort(request.getServerPort())
                .setQuery(request.getQueryString());

        // SLING-11347 - check if the original request was using a mapped path
        @Nullable String resourcePath = uriBuilder.getResourcePath();
        if (resourcePath != null) {
            @NotNull String mappedResourcePath = resourceResolver.map(request, resourcePath);
            if (!resourcePath.equals(mappedResourcePath)
                    && request.getPathInfo().startsWith(mappedResourcePath)) {
                // mapped path is different from the resource path and
                // the request path was the mapped path, so switch to it
                uriBuilder.setResourcePath(mappedResourcePath);
            }
        }
        return uriBuilder;
    }

    /**
     * Creates a builder from an arbitrary URI.
     *
     * @param uri the uri to transform to a SlingUri
     * @param resourceResolver a resource resolver is needed to decide up to what part the path is the resource path (that decision is only
     *        possible by checking against the underlying repository). If null is passed in, the shortest viable resource path is used.
     * @return a SlingUriBuilder
     */
    @NotNull
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



