Package org.apache.sling.api.resource

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


        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();
            response.onDeleted(resource.getPath());
View Full Code Here


                log.debug(
                    "resolve: Mapped path is an URL, using new request path {}",
                    requestPath);
            } catch (URISyntaxException use) {
                // TODO: log and fail
                throw new ResourceNotFoundException(absPath);
            }
        }

        // now we have the real path resolved from virtual host mapping
        // this path may be absolute or relative, in which case we try
View Full Code Here

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

    Session session = request.getResourceResolver().adaptTo(Session.class);
    if (session == null) {
      throw new RepositoryException("JCR Session not found");
View Full Code Here

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

    Session session = request.getResourceResolver().adaptTo(Session.class);
    if (session == null) {
      throw new RepositoryException("JCR Session not found");
View Full Code Here

            Resource resource = request.getResource();
            Authorizable item = resource.adaptTo(Authorizable.class);
            if (item == null) {
                String msg = "Missing source " + resource.getPath() + " for delete";
                htmlResponse.setStatus(HttpServletResponse.SC_NOT_FOUND, msg);
                 throw new ResourceNotFoundException(msg);
            }

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

        // this should be the case, but we never know whether someone really
        // creates a JCR resource with the fs provider folder resource type
        Resource res = request.getResource();
        File file = res.adaptTo(File.class);
        if (file == null || !file.isDirectory()) {
            throw new ResourceNotFoundException(
                request.getResource().getPath(),
                "Resource is not a file system folder");
        }

        response.setContentType("text/html");
View Full Code Here

      throw new RepositoryException("principalIds were not sumitted.");
        } else {
          String resourcePath = null;
          Resource resource = request.getResource();
          if (resource == null) {
          throw new ResourceNotFoundException("Resource not found.");
          } else {
            Item item = resource.adaptTo(Item.class);
            if (item != null) {
              resourcePath = item.getPath();
            } else {
              throw new ResourceNotFoundException("Resource is not a JCR Node");
            }
          }
         
        Session session = request.getResourceResolver().adaptTo(Session.class);
        if (session == null) {
View Full Code Here

        }
       
          String resourcePath = null;
          Resource resource = request.getResource();
          if (resource == null) {
          throw new ResourceNotFoundException("Resource not found.");
          } else {
            Item item = resource.adaptTo(Item.class);
            if (item != null) {
              resourcePath = item.getPath();
            } else {
              throw new ResourceNotFoundException("Resource is not a JCR Node");
            }
          }

          AccessControlEntry[] declaredAccessControlEntries = getDeclaredAccessControlEntries(session, resourcePath);
          Map<String, Map<String, Set<String>>> aclMap = new LinkedHashMap<String, Map<String,Set<String>>>();
View Full Code Here

    }

      String resourcePath = null;
      Resource resource = request.getResource();
      if (resource == null) {
      throw new ResourceNotFoundException("Resource not found.");
      } else {
        Item item = resource.adaptTo(Item.class);
        if (item != null) {
          resourcePath = item.getPath();
        } else {
          throw new ResourceNotFoundException("Resource is not a JCR Node");
        }
      }
   
   
    List<String> grantedPrivilegeNames = new ArrayList<String>();
View Full Code Here

            SlingHttpServletResponse response) throws ServletException,
            IOException {

        // cannot handle the request for missing resources
        if (ResourceUtil.isNonExistingResource(request.getResource())) {
            throw new ResourceNotFoundException(
                request.getResource().getPath(), "No Resource found");
        }

        Servlet rendererServlet;
        String ext = request.getRequestPathInfo().getExtension();
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.