Package org.apache.sling.api.resource

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


    private static final String DECORATED_NAME = "decorated";
   
    /** Wrap any resource so that its name is DECORATED_NAME */
    protected Resource wrapResourceForTest(Resource resource) {
        return new ResourceWrapper(resource) {
            @Override
            public String getName() {
                return DECORATED_NAME;
            }
        };
View Full Code Here


    }

    @Test
    public void testListChildrenWithResourceWrapper() {
        Resource resource = underTest.getResource(resourceResolver, SUPERIMPOSED_PATH);
        Iterator<Resource> iterator = underTest.listChildren(new ResourceWrapper(resource));
        assertTrue(iterator.hasNext());
        assertEquals(SUPERIMPOSED_PATH + "/sub1", iterator.next().getPath());
    }
View Full Code Here

        if (result==null && log.isDebugEnabled()) {
            log.debug("No Mapping applies to node {}, no resource type provided", resource.getPath());
        }
        if ( result != null ) {
            final String resourceType = result;
            return new ResourceWrapper(resource) {

                @Override
                public String getResourceType() {
                    return resourceType;
                }
View Full Code Here

  }

  private Resource getResourceEditorResourceWrapper(Resource resource, String resolutionPathInfo) {
    Resource result = null;
    if (resolutionPathInfo != null && resolutionPathInfo.endsWith("." + RESEDITOR_SELECTOR + ".html")) {
      result = new ResourceWrapper(resource) {
        @Override
        public String getResourceType() {
          /*
           * It overwrites the resource types to avoid that the servlet
           * resource types have a higher priority then the
View Full Code Here

        return decorate(resource);
    }

    public Resource decorate(Resource resource) {
        if(resource.getPath().startsWith(PATH)) {
            return new ResourceWrapper(resource) {
                @Override
                public String getResourceType() {
                    return RESOURCE_TYPE;
                }
            };
View Full Code Here

TOP

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

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.