Package com.sun.jersey.api

Examples of com.sun.jersey.api.NotFoundException


    public Response findProduct(@Context UriInfo uriInfo, @PathParam("eshopId") Long eshopId, @PathParam("productId") Long productId) {
        try {
            ProductDTO product = productService.findById(uriInfo, eshopId, productId);
            return Response.status(Response.Status.OK).entity(product).build();
        } catch (NotExistingEntityException ex) {
            throw new NotFoundException(ex.getMessage());
        }
    }
View Full Code Here


        try {
            Result<ProductDTO> result = productService.findByEshop(uriInfo, eshopId, 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

            @PathParam("linkedEshopId") Long linkedEshopId, @PathParam("linkedProductId") Long linkedProductId) {
        try {
            productService.linkProduct(eshopId, productId, linkedEshopId, linkedProductId);
            return Response.status(Response.Status.NO_CONTENT).build();
        } catch (NotExistingEntityException ex) {
            throw new NotFoundException(ex.getMessage());
        }
    }
View Full Code Here

            @PathParam("linkedEshopId") Long linkedEshopId, @PathParam("linkedProductId") Long linkedProductId) {
        try {
            productService.unlinkProduct(eshopId, productId, linkedEshopId, linkedProductId);
            return Response.status(Response.Status.NO_CONTENT).build();
        } catch (NotExistingEntityException ex) {
            throw new NotFoundException(ex.getMessage());
        }
    }
View Full Code Here

            EditorView view = new EditorView(gaConfig.getWebPropertyID(), "editor", gaConfig.getCustomTrackingCodes());
            view.setBlobId(blobId.toString());
            view.setJsonBlob(blob.toString());
            return view;
        } catch (BlobNotFoundException e) {
            throw new NotFoundException();
        }
    }
View Full Code Here

                }
            }
        }

        if (blobId == null) {
            throw new NotFoundException();
        }

        return createJsonBlobResource(blobId);
    }
View Full Code Here

        try {
            DBObject object = blobManager.read(blobId);
            ObjectId id = (ObjectId) object.get("_id");
            return Response.ok(object.get("blob")).header("X-jsonblob", id).build();
        } catch (BlobNotFoundException e) {
            throw new NotFoundException();
        }
    }
View Full Code Here

        try {
            DBObject object = blobManager.update(blobId, json);
            ObjectId id = (ObjectId) object.get("_id");
            return Response.ok(object.get("blob")).header("X-jsonblob", id).build();
        } catch (BlobNotFoundException e) {
            throw new NotFoundException();
        }
    }
View Full Code Here

        if (blobManager.isDeleteEnabled()) {
            try {
                blobManager.delete(blobId);
                return Response.ok().build();
            } catch (BlobNotFoundException e) {
                throw new NotFoundException();
            }
        }
        return Response.status(HttpStatus.METHOD_NOT_ALLOWED_405).build();
    }
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.