Package com.sun.jersey.api

Examples of com.sun.jersey.api.NotFoundException


    public Container getContainer(@QueryParam("search") String search) {
        System.out.println("GET CONTAINER " + container + ", search = " + search);

        Container c = MemoryStore.MS.getContainer(container);
        if (c == null)
            throw new NotFoundException("Container not found");
       
       
        if (search != null) {
            c = c.clone();
            Iterator<Item> i = c.getItem().iterator();
View Full Code Here


    public void deleteContainer() {
        System.out.println("DELETE CONTAINER " + container);
       
        Container c = MemoryStore.MS.deleteContainer(container);
        if (c == null)
            throw new NotFoundException("Container not found");
    }
View Full Code Here

        try {
            Result<ProductDTO> result = productService.findBy(uriInfo, searchString, categoryId, priceFrom, priceTo, order, base, offset);
            return Response.status(Response.Status.OK).header("X-Count", result.getCount()).entity(result.getData()).build();
        } catch (NotExistingEntityException ex) {
            throw new NotFoundException(ex.getMessage());
        }
    }
View Full Code Here

    public Response updateCategory(@PathParam("id") Long id, CategoryDTO categoryDTO) {
        try {
            categoryService.update(id, categoryDTO);
            return Response.status(Response.Status.NO_CONTENT).build();
        } catch (NotExistingEntityException ex) {
            throw new NotFoundException(ex.getMessage());
        }
    }
View Full Code Here

    public Response findCategory(@Context UriInfo uriInfo, @PathParam("id") Long id) {
        try {
            CategoryDTO category = categoryService.findById(uriInfo, id);
            return Response.status(Response.Status.OK).entity(category).build();
        } catch (NotExistingEntityException ex) {
            throw new NotFoundException(ex.getMessage());
        }
    }
View Full Code Here

        try {
            Result<ProductDTO> result = productService.findByCategory(uriInfo, id, order, base, offset);
            return Response.status(Response.Status.OK).header("X-Count", result.getCount()).entity(result.getData()).build();
        } catch (NotExistingEntityException ex) {
            throw new NotFoundException(ex.getMessage());
        }

    }
View Full Code Here

    public Response updateEshop(@PathParam("id") Long id, EshopDTO eshopDTO) {
        try {
            eshopService.update(id, eshopDTO);
            return Response.status(Response.Status.NO_CONTENT).build();
        } catch (NotExistingEntityException ex) {
            throw new NotFoundException(ex.getMessage());
        }
    }
View Full Code Here

    public Response findEshop(@Context UriInfo uriInfo, @PathParam("id") Long id) {
        try {
            EshopDTO eshop = eshopService.findById(uriInfo, id);
            return Response.status(Response.Status.OK).entity(eshop).build();
        } catch (NotExistingEntityException ex) {
            throw new NotFoundException(ex.getMessage());
        }
    }
View Full Code Here

        try {
            ProductDTO product = productService.create(uriInfo, eshopId, productDTO);
            return Response.status(Response.Status.CREATED)
                    .header("Location", product.getUri()).build();
        } catch (NotExistingEntityException ex) {
            throw new NotFoundException(ex.getMessage());
        }
    }
View Full Code Here

    public Response updateProduct(@PathParam("eshopId") Long eshopId, @PathParam("productId") Long productId, ProductDTO productDTO) {
        try {
            productService.update(eshopId, productId, productDTO);
            return Response.status(Response.Status.NO_CONTENT).build();
        } catch (NotExistingEntityException ex) {
            throw new NotFoundException(ex.getMessage());
        }
    }
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.