Package com.sun.jersey.api

Examples of com.sun.jersey.api.NotFoundException


  @GET
  @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON})
  public Contact getContact() {
    Contact cont = ContactStore.getStore().get(contact);
    if(cont==null)
      throw new NotFoundException("No such Contact.");
    return cont;
  }
View Full Code Here


 
  @DELETE
  public void deleteContact() {
    Contact c = ContactStore.getStore().remove(contact);
    if(c==null)
      throw new NotFoundException("No such Contact.");
  }
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

        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("bookmarks/")
    public BookmarksResource getBookmarksResource() {
        if (null == userEntity) {
            throw new NotFoundException("userid " + userid + " does not exist!");
        }
        return new BookmarksResource(uriInfo, em, utx, 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(utx, new Transactional(em) { public void transact() {
            em.persist(userEntity);
            em.remove(userEntity);
View Full Code Here

        this.utx = utx;

        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

  private ITenant getTenant( String tenantId ) throws NotFoundException {
    ITenant tenant = null;
    if ( tenantId != null ) {
      tenant = tenantManager.getTenant( tenantId );
      if ( tenant == null ) {
        throw new NotFoundException( "Tenant not found." );
      }
    } else {
      IPentahoSession session = PentahoSessionHolder.getSession();
      String tenantPath = (String) session.getAttribute( IPentahoSession.TENANT_ID_KEY );
      if ( tenantPath != null ) {
View Full Code Here

    @Path("items/{itemid}/")
    public Item getItem(@PathParam("itemid") String itemid) {
        Item i = getItems().get(itemid);
        if (i == null)
            throw new NotFoundException("Item, " + itemid + ", is not found");

        return i;
    }
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.