Package org.apache.sling.api.resource

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


    protected void doGet(SlingHttpServletRequest req,
            SlingHttpServletResponse resp) throws ServletException, IOException {
        final Resource r = req.getResource();

        if (ResourceUtil.isNonExistingResource(r)) {
            throw new ResourceNotFoundException("No data to render.");
        }

        resp.setContentType(responseContentType);
        resp.setCharacterEncoding("UTF-8");
View Full Code Here


        if (resources == null) {

            // ensure we have an item underlying the request's resource
            Item item = resource.adaptTo(Item.class);
            if (item == null) {
                throw new ResourceNotFoundException("Missing source "
                    + resource + " for " + getOperationName());
            }

            String dstName = trailingSlash ? null : ResourceUtil.getName(dest);
            execute(changes, item, dstParent, dstName);
View Full Code Here

                         SlingHttpServletResponse resp)
    throws ServletException, IOException {
        final Resource r = req.getResource();

        if (ResourceUtil.isNonExistingResource(r)) {
            throw new ResourceNotFoundException("No data to render.");
        }

        resp.setContentType(responseContentType);
        resp.setCharacterEncoding("UTF-8");
View Full Code Here

    protected void doGet(SlingHttpServletRequest req,
            SlingHttpServletResponse resp) throws IOException {
        // Access and check our data
        final Resource r = req.getResource();
        if (ResourceUtil.isNonExistingResource(r)) {
            throw new ResourceNotFoundException("No data to render.");
        }

        // SLING-167: the last selector, if present, gives the number of
        // recursion levels, 0 being the default
        int maxRecursionLevels = 0;
View Full Code Here

    @Override
    protected void doGet(SlingHttpServletRequest req,
            SlingHttpServletResponse resp) throws ServletException, IOException {
        final Resource r = req.getResource();
        if (ResourceUtil.isNonExistingResource(r)) {
            throw new ResourceNotFoundException("No data to render.");
        }

        /*
         * TODO if(srd != null) { renderSyntheticResource(req, resp, srd);
         * return; }
View Full Code Here

            return;
        }

        final Resource resource = request.getResource();
        if (ResourceUtil.isNonExistingResource(resource)) {
            throw new ResourceNotFoundException("No data to render.");
        }

        // trailing slash on url means directory listing
        if ("/".equals(request.getRequestPathInfo().getSuffix())) {
            renderDirectory(request, response);
View Full Code Here

      authorizable = resource.adaptTo(Authorizable.class);
    }
   
    //check that the user was located.
    if (authorizable == null || authorizable.isGroup()) {
      throw new ResourceNotFoundException("User to update could not be determined.");
    }

    if ("anonymous".equals(authorizable.getID())) {
      throw new RepositoryException("Can not change the password of the anonymous user.");
    }
View Full Code Here

        if (res == null) {

            Resource resource = request.getResource();
            Item item = resource.adaptTo(Item.class);
            if (item == null) {
                throw new ResourceNotFoundException("Missing source "
                    + resource + " for delete");
            }

            item.remove();
            changes.add(Modification.onDeleted(resource.getPath()));
View Full Code Here

TOP

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

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.