Package org.apache.sling.api.resource

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


            {
                allowing(resolver).resolve(with(any(HttpServletRequest.class)), with(equal("/absolute/path")));
                will(returnValue(new SyntheticResource(resolver, "/absolute/path", "test")));

                allowing(resolver).resolve(with(any(HttpServletRequest.class)), with(equal("relative/path")));
                will(returnValue(new NonExistingResource(resolver, "relative/path")));

                allowing(resolver).resolve(with(any(HttpServletRequest.class)), with(any(String.class)));
                will(returnValue(new NonExistingResource(resolver, "/absolute/missing")));

                allowing(request).getAttribute(with(AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER));
                will(returnValue(resolver));

                allowing(request).getAttribute(with(any(String.class)));
View Full Code Here


            {
                allowing(resolver).resolve(with(any(HttpServletRequest.class)), with(equal("/absolute/path")));
                will(returnValue(new SyntheticResource(resolver, "/absolute/path", "test")));

                allowing(resolver).resolve(with(any(HttpServletRequest.class)), with(equal("relative/path")));
                will(returnValue(new NonExistingResource(resolver, "relative/path")));

                allowing(request).getAttribute(with(AuthenticationSupport.REQUEST_ATTRIBUTE_RESOLVER));
                will(returnValue(resolver));

                allowing(request).getAttribute(with(any(String.class)));
View Full Code Here

        // if no resource has been found, use a NonExistingResource
        if (res == null) {
            final String resourcePath = ensureAbsPath(realPathList[0]);
            logger.debug("resolve: Path {} does not resolve, returning NonExistingResource at {}", absPath, resourcePath);

            res = new NonExistingResource(this, resourcePath);
            // SLING-864: if the path contains a dot we assume this to be
            // the start for any selectors, extension, suffix, which may be
            // used for further request processing.
            // the resolution path must be the full path and is already set within
            // the non existing resource
View Full Code Here

                        final Resource superTypeResource = resolver.getResource(superTypeChildPath);
                        if (superTypeResource != null) {
                            resources.add(superTypeResource);
                            currentTarget = superTypeResource;
                        } else {
                            resources.add(new NonExistingResource(resolver, superTypeChildPath));
                            currentTarget = null;
                        }
                    }
                }
            }
View Full Code Here

            final String fullPath = basePath + relativePath;
            final Resource resource = resolver.getResource(fullPath);
            if (resource != null) {
                resources.add(resource);
            } else {
                resources.add(new NonExistingResource(resolver, fullPath));
            }
        }
        return resources;
    }
View Full Code Here

        if (result == null) {
            if(StarResource.appliesTo(request)) {
                result = new StarResource(this, pathInfo, rootProvider.getResourceTypeProviders());
            } else {
                result = new NonExistingResource(this, pathInfo);
            }
        }

        return result;
    }
View Full Code Here

        // if no resource has been found, use a NonExistingResource
        if (res == null) {
            log.debug(
                "resolve: Path {} does not resolve, returning NonExistingResource at {}",
                absPath, realPathList[0]);
            res = new NonExistingResource(this, ensureAbsPath(realPathList[0]));
        } else {
            log.debug("resolve: Path {} resolves to Resource {}", absPath, res);
        }

        return res;
View Full Code Here

TOP

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

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.