Package com.sun.jersey.api

Examples of com.sun.jersey.api.NotFoundException


        if (!resourceConfig.getFeature(ResourceConfig.FEATURE_MATCH_MATRIX_PARAMS)) {
            path = stripMatrixParams(path);
        }

        if (!rootsRule.accept(path, null, localContext)) {
            throw new NotFoundException(request.getRequestUri());
        }
    }
View Full Code Here


    @Path("{id}")
    public ItemResource getItem( @PathParam("id") final Integer id ) {
        final Item item = _repository.get( id );
        if ( item == null ) {
            throw new NotFoundException("Item with id " + id + " does not exist!");
        }
       
        return new ItemResource( item );
    }
View Full Code Here

    }
   
    @Path("bookmarks/")
    public BookmarksResource getBookmarksResource() {
        if (null == userEntity) {
            throw new NotFoundException("userid " + userid + " does not exist!");
        }
        return new BookmarksResource(uriInfo, em, this);
    }
View Full Code Here

   
    @GET
    @Produces("application/json")
    public JSONObject getUser() throws JSONException {
        if (null == userEntity) {
            throw new NotFoundException("userid " + userid + "does not exist!");
        }
        return new JSONObject()
            .put("userid", userEntity.getUserid())
            .put("username", userEntity.getUsername())
            .put("email", userEntity.getEmail())
View Full Code Here

    }
   
    @DELETE
    public void deleteUser() {
        if (null == userEntity) {
            throw new NotFoundException("userid " + userid + "does not exist!");
        }
        TransactionManager.manage(new Transactional(em) { public void transact() {
            em.remove(userEntity);
        }});
    }
View Full Code Here

        this.uriInfo = uriInfo;
        this.em = em;
        bookmarkEntity = em.find(BookmarkEntity.class,
                new BookmarkEntityPK(bmid, userEntity.getUserid()));
        if (null == bookmarkEntity) {
            throw new NotFoundException("bookmark with userid=" +
                    userEntity.getUserid() + " and bmid=" +
                    bmid + " not found\n");
        }
        bookmarkEntity.setUserEntity(userEntity);
    }
View Full Code Here

            }
        }

        if (contentAsBytes == null) {
            logger.info("Could not find resource: " + uriInfo.getPath());
            throw new NotFoundException();
        } else {
            return Response.ok(contentAsBytes, mediaType).build();
        }
    }
View Full Code Here

    public Response getItem() {
        System.out.println("GET ITEM " + container + " " + item);
       
        Item i = MemoryStore.MS.getItem(container, item);
        if (i == null)
            throw new NotFoundException("Item not found");
        Date lastModified = i.getLastModified().getTime();
        EntityTag et = new EntityTag(i.getDigest());
        ResponseBuilder rb = request.evaluatePreconditions(lastModified, et);
        if (rb != null)
            return rb.build();
View Full Code Here

                    build().normalize();
            Container c = new Container(container, containerUri.toString());
            MemoryStore.MS.createContainer(c);
            i = MemoryStore.MS.createOrUpdateItem(container, i, data);
            if (i == null)
                throw new NotFoundException("Container not found");
        }
       
        return r;
    }   
View Full Code Here

    public void deleteItem() {
        System.out.println("DELETE ITEM " + container + " " + item);
       
        Item i = MemoryStore.MS.deleteItem(container, item);
        if (i == null) {
            throw new NotFoundException("Item not found");
        }
    }
View Full Code Here

TOP

Related Classes of com.sun.jersey.api.NotFoundException

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.