Package javax.ws.rs.core.Response

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


                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

                    builder.header(eachHeader.getKey(), value == null ? "" : value);
                }

                // status code
                int statusCode = httpUrlConnection.getResponseCode();
                builder.status(statusCode);

                // last modified
                long lastModified = urlConnection.getLastModified();
                if (lastModified >= 0) {
                    builder.lastModified(new Date(lastModified));
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
                .trace("evaluatePreconditions() returning built response because there was no match due to no entity tag"); //$NON-NLS-1$
            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.trace("evaluateIfMatch returning built response because there was no match"); //$NON-NLS-1$
            return responseBuilder;
        }
        logger.trace("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
                    .trace("evaluateIfNoneMatch returning 304 Not Modified because the {} method matched", //$NON-NLS-1$
                           method);
                responseBuilder.status(HttpServletResponse.SC_NOT_MODIFIED).tag(tag);
            } else {
                logger
                    .trace("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
                    .trace("evaluateIfNoneMatch returning 412 Precondition Failed because the {} method matched", //$NON-NLS-1$
                           method);
                responseBuilder.status(HttpServletResponse.SC_PRECONDITION_FAILED).tag(tag);
            }
            return responseBuilder;
        }
        logger.trace("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.trace("evalueateIfUnmodifiedSince returning 412 Precondition Failed"); //$NON-NLS-1$
            return responseBuilder;
        }
        logger.trace("evalueateIfUnmodifiedSince returning null"); //$NON-NLS-1$
        return null;
View Full Code Here

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

    public ResponseBuilder evaluatePreconditions(Date lastModified, EntityTag 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.