Examples of ResourceNotFoundException


Examples of org.apache.flex.forks.velocity.exception.ResourceNotFoundException

            /*
             * If we don't get a properly formed templateName then
             * there's not much we can do. So we'll forget about
             * trying to search any more paths for the template.
             */
            throw new ResourceNotFoundException(
                "Need to specify a file name or file path!");
        }

        String template = StringUtils.normalizePath(templateName);
        if ( template == null || template.length() == 0 )
        {
            String msg = "File resource error : argument " + template +
                " contains .. and may be trying to access " +
                "content outside of template root.  Rejected.";

            rsvc.error( "FileResourceLoader : " + msg );
     
            throw new ResourceNotFoundException ( msg );
        }

        /*
         *  if a / leads off, then just nip that :)
         */
        if (template.startsWith("/"))
        {
            template = template.substring(1);
        }

        int size = paths.size();
        for (int i = 0; i < size; i++)
        {
            String path = (String) paths.get(i);
            InputStream inputStream = findTemplate(path, template);
           
            if (inputStream != null)
            {
                /*
                 * Store the path that this template came
                 * from so that we can check its modification
                 * time.
                 */

                templatePaths.put(templateName, path);
                return inputStream;
            }               
        }
   
        /*
         * We have now searched all the paths for
         * templates and we didn't find anything so
         * throw an exception.
         */
         String msg = "FileResourceLoader Error: cannot find resource " +
          template;
   
         throw new ResourceNotFoundException( msg );
    }
View Full Code Here

Examples of org.apache.lucene.gdata.storage.ResourceNotFoundException

        if (set.size() > 1)
            throw new StorageException("Query for feed id " + feedId
                    + " returns more than one result");
        if (set.hasNext())
        return (BaseFeed<BaseFeed, BaseEntry>) set.next();
        throw new ResourceNotFoundException("can not find feed for given feed id -- "
                + feedId);

    }
View Full Code Here

Examples of org.apache.rave.exception.ResourceNotFoundException

        return tokenService.getEncryptedSecurityToken(item.getId(), item.getWidgetUrl(), item.getOwnerId());
    }

    private void validate(Widget widget) {
        if(widget == null) {
            throw new ResourceNotFoundException("The requested gadget does not exist in the gadget store.");
        } else if(widget.getWidgetStatus().equals(WidgetStatus.PREVIEW)) {
            throw new IllegalStateException("The requested gadget exists in the gadget store but is not published.");
        }
    }
View Full Code Here

Examples of org.apache.rave.rest.exception.ResourceNotFoundException

    }

    private org.apache.rave.model.Widget getFromService(String id) {
        org.apache.rave.model.Widget widget = widgetService.getWidget(id);
        if(widget == null) {
            throw new ResourceNotFoundException("Could not find widget with ID " + id);
        }
        return widget;
    }
View Full Code Here

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

            Authorizable item = resource.adaptTo(Authorizable.class);
            if (item == null) {
                String msg = "Missing source " + resource.getPath()
                    + " for delete";
                response.setStatus(HttpServletResponse.SC_NOT_FOUND, msg);
                throw new ResourceNotFoundException(msg);
            } else {
                if (item instanceof User) {
                    deleteUser(session, item.getID(), changes);
                } else if (item instanceof Group) {
                    deleteGroup(session, item.getID(), changes);
View Full Code Here

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

        UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
        Authorizable authorizable = userManager.getAuthorizable(name);
        if (authorizable instanceof Group) {
            group = (Group)authorizable;
        } else {
            throw new ResourceNotFoundException(
                "Group to delete could not be determined");
        }
       
        String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
                                + group.getID();
View Full Code Here

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

        UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
        Authorizable authorizable = userManager.getAuthorizable(name);
        if (authorizable instanceof User) {
            user = (User)authorizable;
        } else {
            throw new ResourceNotFoundException(
                "User to update could not be determined");
        }

        //SLING-2069: if the current user is an administrator, then a missing oldPwd is ok,
        // otherwise the oldPwd must be supplied.
View Full Code Here

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

        UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
        Authorizable authorizable = userManager.getAuthorizable(name);
        if (authorizable instanceof Group) {
            group = (Group)authorizable;
        } else {
            throw new ResourceNotFoundException(
                "Group to update could not be determined");
        }
       
        String groupPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
            + group.getID();
View Full Code Here

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

        UserManager userManager = AccessControlUtil.getUserManager(jcrSession);
        Authorizable authorizable = userManager.getAuthorizable(name);
        if (authorizable instanceof User) {
            user = (User)authorizable;
        } else {
            throw new ResourceNotFoundException(
                "User to update could not be determined");
        }

        String userPath = AuthorizableResourceProvider.SYSTEM_USER_MANAGER_GROUP_PREFIX
            + user.getID();
View Full Code Here

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(req.getResponseContentType());
        resp.setCharacterEncoding("UTF-8");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.