Package org.apache.sling.servlets.resolver.helper

Examples of org.apache.sling.servlets.resolver.helper.ResourceCollector


            String path = base[baseIdx] + name;
            createScriptResource(path, "nt:file");
            pathMap.put(name, path);
        }
       
        ResourceCollector lu = ResourceCollector.create(request);
        Collection<Resource> res = lu.getServlets(request.getResource());
        Iterator<Resource> rIter = res.iterator();

        for (int index : indices) {
            assertTrue(rIter.hasNext());
View Full Code Here


            resourceResolver.addResource(r);           
        }
       
        // Create mock request and get scripts from ResourceCollector
        final MockSlingHttpServletRequest req = makeRequest(method, selectors, extension);
        final ResourceCollector u = ResourceCollector.create(req);
        final Collection<Resource> s = u.getServlets(req.getResource());
       
        if(expectedScript == null) {
            assertFalse("No script must be found", s.iterator().hasNext());
        } else {
            // Verify that the expected script is the first in the list of candidates
View Full Code Here

            }
        }

        // the resource type is not absolute, so lets go for the deep search
        if (servlet == null) {
            ResourceCollector locationUtil = ResourceCollector.create(request);
            servlet = getServlet(locationUtil, request, resource);
        }

        // last resort, use the core bundle default servlet
        if (servlet == null) {
View Full Code Here

            // find the error handler component
            Resource resource = getErrorResource(request);

            // find a servlet for the status as the method name
            ResourceCollector locationUtil = new ResourceCollector(
                String.valueOf(status),
                ServletResolverConstants.ERROR_HANDLER_PATH);
            Servlet servlet = getServlet(locationUtil, request, resource);

            // fall back to default servlet if none
View Full Code Here

            Resource resource = getErrorResource(request);

            Class<?> tClass = throwable.getClass();
            while (servlet == null && tClass != Object.class) {
                // find a servlet for the simple class name as the method name
                ResourceCollector locationUtil = new ResourceCollector(
                    tClass.getSimpleName(),
                    ServletResolverConstants.ERROR_HANDLER_PATH);
                servlet = getServlet(locationUtil, request, resource);

                // go to the base class
View Full Code Here

TOP

Related Classes of org.apache.sling.servlets.resolver.helper.ResourceCollector

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.