Package org.apache.sling.api.resource

Examples of org.apache.sling.api.resource.SyntheticResource


     * @param request The request whose resource is to be returned.
     */
    private Resource getErrorResource(SlingHttpServletRequest request) {
        Resource res = request.getResource();
        if (res == null) {
            res = new SyntheticResource(request.getResourceResolver(),
                request.getPathInfo(),
                ServletResolverConstants.ERROR_HANDLER_PATH);
        }
        return res;
    }
View Full Code Here


                } else {
                    path = base.getPath() + "/" + path;
                }
            }

            res = new SyntheticResource(resolver, path, "$synthetic$");
        }

        return res;
    }
View Full Code Here

     * @param request The request whose resource is to be returned.
     */
    private Resource getErrorResource(SlingHttpServletRequest request) {
        Resource res = request.getResource();
        if (res == null) {
            res = new SyntheticResource(request.getResourceResolver(),
                request.getPathInfo(),
                ServletResolverConstants.ERROR_HANDLER_PATH);
        }
        return res;
    }
View Full Code Here

                } else {
                    path = base.getPath() + "/" + path;
                }
            }

            res = new SyntheticResource(resolver, path, "$synthetic$");
        }

        return res;
    }
View Full Code Here

                path = path.substring(0, nextSlash);
                if (!visited.contains(path)) {
                    visited.add(path);
                    Resource res =  parentResource.getResourceResolver().getResource(path);
                    if (res == null) {
                        res = new SyntheticResource(
                            parentResource.getResourceResolver(), path,
                            ResourceProvider.RESOURCE_TYPE_SYNTHETIC);
                    }
                    return res;
                }
View Full Code Here

   */
  public Resource getResource(ResourceResolver resourceResolver, String path) {
   
    //handle resources for the virtual container resources
    if (path.equals(SYSTEM_USER_MANAGER_PATH)) {
      return new SyntheticResource(resourceResolver, path, "sling:userManager");
    } else if (path.equals(SYSTEM_USER_MANAGER_USER_PATH)) {
      return new SyntheticResource(resourceResolver, path, "sling:users");
    } else if (path.equals(SYSTEM_USER_MANAGER_GROUP_PATH)) {
      return new SyntheticResource(resourceResolver, path, "sling:groups");
    }
   
    // the principalId should be the first segment after the prefix
    String pid = null;
    if (path.startsWith(SYSTEM_USER_MANAGER_USER_PREFIX)) {
View Full Code Here

            // returned for the requested path
            if (resource == null && entries != null) {
                String checkPath = path.concat("/");
                for (ResourceProviderEntry entry : entries) {
                    if (entry.path.startsWith(checkPath)) {
                        resource = new SyntheticResource(resourceResolver, fullPath,
                            ResourceProvider.RESOURCE_TYPE_SYNTHETIC);
                       
                        // don't look further
                        break;
                    }
View Full Code Here

        this(null, null, null, null, null);
    }

    public MockSlingHttpServletRequest(String resourcePath, String selectors,
            String extension, String suffix, String queryString) {
        this.resource = new SyntheticResource(null, resourcePath, null);
        this.requestPathInfo = new MockRequestPathInfo(selectors, extension,
            suffix);
        this.queryString = queryString;
    }
View Full Code Here

        this(null, null, null, null, null);
    }

    public MockSlingHttpServletRequest(String resourcePath, String selectors,
            String extension, String suffix, String queryString) {
        this.resource = new SyntheticResource(null, resourcePath, RESOURCE_TYPE);
        this.requestPathInfo = new MockRequestPathInfo(selectors, extension,
            suffix);
        this.queryString = queryString;

        setMethod(null);
View Full Code Here

    public void setResourceResolver(MockResourceResolver resolver) {
        this.mockResourceResolver = resolver;

        // recreate request resource with the new resolver
        if (resource.getResourceResolver() == null) {
            this.resource = new SyntheticResource(resolver, resource.getPath(),
                resource.getResourceType());
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.sling.api.resource.SyntheticResource

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.