Package org.apache.sling.api.resource

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


            if ( !isResolve ) {
                if (entries.size() > 0 && entries.size() == elements.length) {
                    final ResourceProviderEntry lastEntry = entries.get(entries.size() - 1);
                    if (lastEntry.getResourceProviders().length == 0) {
                        logger.debug("Resolved Synthetic {}", fullPath);
                        return new SyntheticResource(resourceResolver, fullPath, ResourceProvider.RESOURCE_TYPE_SYNTHETIC);
                    }
                }
            }
            logger.debug("Resource null {} ", fullPath);
            return null;
View Full Code Here


        @Override
        public Resource getResource() {
            if (this.delegatee == null) {
                this.delegatee = this.resolver.getResource(this.path);
                if (this.delegatee == null) {
                    this.delegatee = new SyntheticResource(resolver, this.path,
                        this.resourceType);
                }
            }
            return this.delegatee;
        }
View Full Code Here

  public MockSlingHttpServletRequest(String resourcePath, String selectors,
      String extension, String suffix, String queryString,
      String requestPath, String scheme, String server, int port,
      String contextPath) {
    this.resource = new SyntheticResource(null, resourcePath, RESOURCE_TYPE);
    this.requestPathInfo = new MockRequestPathInfo(selectors, extension,
      suffix, requestPath);
    this.queryString = queryString;
    this.scheme = scheme;
    this.server = server;
View Full Code Here

    public void setResourceResolver(ResourceResolver 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

   
    /** ResourceProvider interface */
    public Resource getResource(ResourceResolver resolver, HttpServletRequest req, String path) {
        // Synthetic resource for the root, so that /reseditor works
        if((ABS_ROOT).equals(path)) {
            return new SyntheticResource(resolver, path, "reseditor");
        }
        Resource originalResource = resolver.resolve(req, path.substring(ROOT.length()));
        return originalResource;
    }
View Full Code Here

    /** ResourceProvider interface */
    public Resource getResource(ResourceResolver resolver, String path) {
        // Synthetic resource for the root, so that /reseditor works
        if((ABS_ROOT).equals(path)) {
            return new SyntheticResource(resolver, path, "reseditor");
        }
        Resource originalResource = resolver.resolve(path.substring(ROOT.length()+1));
        return originalResource;
    }
View Full Code Here

   
    /** ResourceProvider interface */
    public Resource getResource(ResourceResolver resolver, HttpServletRequest req, String path) {
        // Synthetic resource for our root, so that /planets works
        if((ABS_ROOT).equals(path)) {
            return new SyntheticResource(resolver, path, PlanetResource.RESOURCE_TYPE);
        }
       
        // Not root, return a Planet if we have one
        final ValueMap data = PLANETS.get(path);
        return data == null ? null : new PlanetResource(resolver, path, data);
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

                resource = request.getResource();
            } else {
                // check whether the path (would) resolve, else SyntheticRes.
                Resource tmp = request.getResourceResolver().resolve(path);
                if (tmp == null && resourceType != null) {
                    resource = new SyntheticResource(
                        request.getResourceResolver(), path, resourceType);

                    // remove resource type overwrite as synthetic resource
                    // is correctly typed as requested
                    opts.remove(RequestDispatcherOptions.OPT_FORCE_RESOURCE_TYPE);
View Full Code Here

                path = path.substring(0, nextSlash);
                if (!visited.contains(path)) {
                    visited.add(path);
                    if (parentResource.getResourceResolver().getResource(path) == null) {
                        return new SyntheticResource(
                            parentResource.getResourceResolver(), path,
                            ResourceProvider.RESOURCE_TYPE_SYNTHETIC);
                    }
                }
            }
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.