Package javax.ws.rs.core

Examples of javax.ws.rs.core.EntityTag


        try {
            for (String value : ifMatch) {
                if ("*".equals(value)) {
                    return null;
                }
                EntityTag requestTag = EntityTag.valueOf(value);
                // must be a strong comparison
                if (!requestTag.isWeak() && !eTag.isWeak() && requestTag.equals(eTag)) {
                    return null;
                }
            }
        } catch (IllegalArgumentException ex) {
            // ignore
View Full Code Here


        boolean getOrHead = "GET".equals(method) || "HEAD".equals(method);
        try {
            for (String value : ifNonMatch) {
                boolean result = "*".equals(value);
                if (!result) {
                    EntityTag requestTag = EntityTag.valueOf(value);
                    result = getOrHead ? requestTag.equals(eTag)
                        : !requestTag.isWeak() && !eTag.isWeak() && requestTag.equals(eTag);
                }
                if (result) {
                    Response.Status status = getOrHead ? Response.Status.NOT_MODIFIED
                        : Response.Status.PRECONDITION_FAILED;
                    return Response.status(status).tag(eTag);
View Full Code Here

    @GET
    @Path("/books/response/{bookId}/")
    @Produces("application/xml")
    public Response getBookAsResponse(@PathParam("bookId") String id) throws BookNotFoundFault {
        Book entity = doGetBook(id);
        EntityTag etag = new EntityTag(Integer.toString(entity.hashCode()));
        return Response.ok().tag(etag).entity(entity).build();
    }
View Full Code Here

    @GET
    @Path("/books/response/{bookId}/")
    @Produces("application/xml")
    public Response getBookAsResponse(@PathParam("bookId") String id) throws BookNotFoundFault {
        Book entity = doGetBook(id);
        EntityTag etag = new EntityTag(Integer.toString(entity.hashCode()));
        return Response.ok().tag(etag).entity(entity).build();
    }
View Full Code Here

    @GET
    @Path("/books/response/{bookId}/")
    @Produces("application/xml")
    public Response getBookAsResponse(@PathParam("bookId") String id) throws BookNotFoundFault {
        Book entity = doGetBook(id);
        EntityTag etag = new EntityTag(Integer.toString(entity.hashCode()));
        return Response.ok().tag(etag).entity(entity).build();
    }
View Full Code Here

    @GET
    @Path("/books/response/{bookId}/")
    @Produces("application/xml")
    public Response getBookAsResponse(@PathParam("bookId") String id) throws BookNotFoundFault {
        Book entity = doGetBook(id);
        EntityTag etag = new EntityTag(Integer.toString(entity.hashCode()));
        return Response.ok().tag(etag).entity(entity).build();
    }
View Full Code Here

    public static final String GERMAN_TEXT = "Text auf deutsch";

    public static final String ENGLISH_TEXT = "Text in english";

    public static EntityTag getEntityTagFromDatastore() {
        return new EntityTag("validEntityTag");
    }
View Full Code Here

    @GET
    @Path("date")
    @Produces("text/plain")
    public Response get(@Context Request request) {
        final Date modificDate = getLastModificationDateFromDatastore();
        final EntityTag entityTag = getEntityTagFromDatastore();
        final ResponseBuilder resp = request.evaluatePreconditions(modificDate,
                entityTag);
        if (resp != null) {
            return resp.build();
        }
View Full Code Here

    @PUT
    @Path("date")
    public Response put(@Context Request request) {
        final Date modificDate = getLastModificationDateFromDatastore();
        final EntityTag entityTag = getEntityTagFromDatastore();
        final ResponseBuilder resp = request.evaluatePreconditions(modificDate,
                entityTag);
        if (resp != null) {
            return resp.build();
        }
View Full Code Here

     */
    public static EntityTag toJaxRsEntityTag(Tag restletEntityTag) {
        if (restletEntityTag == null) {
            return null;
        }
        return new EntityTag(restletEntityTag.getName(), restletEntityTag
                .isWeak());
    }
View Full Code Here

TOP

Related Classes of javax.ws.rs.core.EntityTag

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.