Package javax.ws.rs.core.Response

Examples of javax.ws.rs.core.Response.ResponseBuilder.status()


                throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
            }
            // we won't find a match. To be consistent with evaluateIfMatch, we
            // return a built response
            ResponseBuilder responseBuilder = delegate.createResponseBuilder();
            responseBuilder.status(HttpServletResponse.SC_PRECONDITION_FAILED);
            logger
                .debug("evaluatePreconditions() returning built response because there was no match due to no entity tag");
            return responseBuilder;
        }
View Full Code Here


        }

        if (!ifMatchHeader.isMatch(tag)) {
            // none of the tags matches the etag
            ResponseBuilder responseBuilder = delegate.createResponseBuilder();
            responseBuilder.status(HttpServletResponse.SC_PRECONDITION_FAILED).tag(tag);
            logger.debug("evaluateIfMatch returning built response because there was no match"); //$NON-NLS-1$
            return responseBuilder;
        }
        logger.debug("evaluateIfMatch returning null because there was a match"); //$NON-NLS-1$
        return null;
View Full Code Here

            String method = getMethod();
            if (method.equalsIgnoreCase("GET") || method.equalsIgnoreCase("HEAD")) { //$NON-NLS-1$ //$NON-NLS-2$
                logger
                    .debug("evaluateIfNoneMatch returning 304 Not Modified because the {} method matched", //$NON-NLS-1$
                           method);
                responseBuilder.status(HttpServletResponse.SC_NOT_MODIFIED).tag(tag);
            } else {
                logger
                    .debug("evaluateIfNoneMatch returning 412 Precondition Failed because the {} method matched", //$NON-NLS-1$
                           method);
                responseBuilder.status(HttpServletResponse.SC_PRECONDITION_FAILED).tag(tag);
View Full Code Here

                responseBuilder.status(HttpServletResponse.SC_NOT_MODIFIED).tag(tag);
            } else {
                logger
                    .debug("evaluateIfNoneMatch returning 412 Precondition Failed because the {} method matched", //$NON-NLS-1$
                           method);
                responseBuilder.status(HttpServletResponse.SC_PRECONDITION_FAILED).tag(tag);
            }
            return responseBuilder;
        }
        logger.debug("evaluateIfNoneMatch returning null because there was no match"); //$NON-NLS-1$
        return null;
View Full Code Here

                       new Object[] {lastModified, headerValue, date, lastModified.getTime(),
                           date.getTime()});
        }
        if (lastModified.after(date)) {
            ResponseBuilder responseBuilder = delegate.createResponseBuilder();
            responseBuilder.status(HttpServletResponse.SC_PRECONDITION_FAILED);
            logger.debug("evalueateIfUnmodifiedSince returning 412 Precondition Failed"); //$NON-NLS-1$
            return responseBuilder;
        }
        logger.debug("evalueateIfUnmodifiedSince returning null"); //$NON-NLS-1$
        return null;
View Full Code Here

        if (lastModified.after(date)) {
            logger.debug("evaluateIfModifiedSince returning null"); //$NON-NLS-1$
            return null;
        }
        ResponseBuilder responseBuilder = delegate.createResponseBuilder();
        responseBuilder.status(HttpServletResponse.SC_NOT_MODIFIED);
        logger.debug("evaluateIfModifiedSince returning 304 Not Modified"); //$NON-NLS-1$
        return responseBuilder;
    }

    public ResponseBuilder evaluatePreconditions(Date lastModified, EntityTag tag) {
View Full Code Here

                        ResponseBuilder responseBuilder =
                            RuntimeDelegate.getInstance().createResponseBuilder();
                        // send back a media type that has q=0 -- this should be
                        // detected somewhere
                        responseBuilder.type(new MediaType("image", "jpeg"));
                        return responseBuilder.status(Response.Status.OK).entity("unknown string")
                            .build();
                    }
                }
            }
            return RuntimeDelegate.getInstance().createResponseBuilder().status(Response.Status.OK)
View Full Code Here

                throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
            }
            // we won't find a match. To be consistent with evaluateIfMatch, we
            // return a built response
            ResponseBuilder responseBuilder = delegate.createResponseBuilder();
            responseBuilder.status(HttpServletResponse.SC_PRECONDITION_FAILED);
            logger
                .debug("evaluatePreconditions() returning built response because there was no match due to no entity tag");
            return responseBuilder;
        }
View Full Code Here

        }

        if (!ifMatchHeader.isMatch(tag)) {
            // none of the tags matches the etag
            ResponseBuilder responseBuilder = delegate.createResponseBuilder();
            responseBuilder.status(HttpServletResponse.SC_PRECONDITION_FAILED).tag(tag);
            logger.debug("evaluateIfMatch returning built response because there was no match"); //$NON-NLS-1$
            return responseBuilder;
        }
        logger.debug("evaluateIfMatch returning null because there was a match"); //$NON-NLS-1$
        return null;
View Full Code Here

            String method = getMethod();
            if (method.equalsIgnoreCase("GET") || method.equalsIgnoreCase("HEAD")) { //$NON-NLS-1$ //$NON-NLS-2$
                logger
                    .debug("evaluateIfNoneMatch returning 304 Not Modified because the {} method matched", //$NON-NLS-1$
                           method);
                responseBuilder.status(HttpServletResponse.SC_NOT_MODIFIED).tag(tag);
            } else {
                logger
                    .debug("evaluateIfNoneMatch returning 412 Precondition Failed because the {} method matched", //$NON-NLS-1$
                           method);
                responseBuilder.status(HttpServletResponse.SC_PRECONDITION_FAILED).tag(tag);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.