Examples of EntityTagMatchHeader


Examples of org.apache.wink.common.internal.http.EntityTagMatchHeader

    /**
     * returns ResponseBuilder if none of the tags matched
     */
    private ResponseBuilder evaluateIfMatch(EntityTag tag, String headerValue) {
        EntityTagMatchHeader ifMatchHeader = null;
        try {
            ifMatchHeader = ifMatchHeaderDelegate.fromString(headerValue);
        } catch (IllegalArgumentException e) {
            throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
        }

        if (!ifMatchHeader.isMatch(tag)) {
            // none of the tags matches the etag
            ResponseBuilder responseBuilder = delegate.createResponseBuilder();
            responseBuilder.status(HttpServletResponse.SC_PRECONDITION_FAILED).tag(tag);
            return responseBuilder;
        }
View Full Code Here

Examples of org.apache.wink.common.internal.http.EntityTagMatchHeader

    /**
     * returns ResponseBuilder if any of the tags matched
     */
    private ResponseBuilder evaluateIfNoneMatch(EntityTag tag, String headerValue) {
        EntityTagMatchHeader ifNoneMatchHeader = null;
        try {
            ifNoneMatchHeader = ifMatchHeaderDelegate.fromString(headerValue);
        } catch (IllegalArgumentException e) {
            throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
        }

        if (ifNoneMatchHeader.isMatch(tag)) {
            // some tag matched
            ResponseBuilder responseBuilder = delegate.createResponseBuilder();
            String method = getMethod();
            if (method.equalsIgnoreCase("GET") || method.equalsIgnoreCase("HEAD")) {
                responseBuilder.status(HttpServletResponse.SC_NOT_MODIFIED).tag(tag);
View Full Code Here

Examples of org.apache.wink.common.internal.http.EntityTagMatchHeader

    /**
     * returns ResponseBuilder if none of the tags matched
     */
    private ResponseBuilder evaluateIfMatch(EntityTag tag, String headerValue) {
        logger.debug("evaluateIfMatch({}, {}) called", tag, headerValue);
        EntityTagMatchHeader ifMatchHeader = null;
        try {
            ifMatchHeader = ifMatchHeaderDelegate.fromString(headerValue);
            logger.debug("ifMatchHeaderDelegate returned {}", ifMatchHeader);
        } catch (IllegalArgumentException e) {
            throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
        }

        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");
            return responseBuilder;
View Full Code Here

Examples of org.apache.wink.common.internal.http.EntityTagMatchHeader

    /**
     * returns ResponseBuilder if any of the tags matched
     */
    private ResponseBuilder evaluateIfNoneMatch(EntityTag tag, String headerValue) {
        logger.debug("evaluateIfNoneMatch({}, {}) called", tag, headerValue);
        EntityTagMatchHeader ifNoneMatchHeader = null;
        try {
            ifNoneMatchHeader = ifMatchHeaderDelegate.fromString(headerValue);
            logger.debug("ifMatchHeaderDelegate returned {}", ifNoneMatchHeader);
        } catch (IllegalArgumentException e) {
            throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
        }

        if (ifNoneMatchHeader.isMatch(tag)) {
            // some tag matched
            ResponseBuilder responseBuilder = delegate.createResponseBuilder();
            String method = getMethod();
            if (method.equalsIgnoreCase("GET") || method.equalsIgnoreCase("HEAD")) {
                logger
View Full Code Here

Examples of org.apache.wink.common.internal.http.EntityTagMatchHeader

                                                                                  delegate
                                                                                      .createHeaderDelegate(EntityTag.class);

    public EntityTagMatchHeader fromString(String value) throws IllegalArgumentException {
        String[] valueTokens = value.split(",");
        EntityTagMatchHeader ifMatchHeader = new EntityTagMatchHeader();
        for (String token : valueTokens) {
            ifMatchHeader.addETag(ENTITY_TAG_HEADER_DELEGATE.fromString(token));
        }
        return ifMatchHeader;
    }
View Full Code Here

Examples of org.apache.wink.common.internal.http.EntityTagMatchHeader

        // the resource does not exist yet so any If-Match header would result
        // in a precondition failed
        String ifMatch = getHeaderValue(HttpHeaders.IF_MATCH);
        if (ifMatch != null) {
            try {
                EntityTagMatchHeader ifMatchHeader = null;
                ifMatchHeader = ifMatchHeaderDelegate.fromString(ifMatch);
                logger.debug("ifMatchHeaderDelegate returned {}", ifMatchHeader);
            } catch (IllegalArgumentException e) {
                throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
            }
View Full Code Here

Examples of org.apache.wink.common.internal.http.EntityTagMatchHeader

    /**
     * returns ResponseBuilder if none of the tags matched
     */
    private ResponseBuilder evaluateIfMatch(EntityTag tag, String headerValue) {
        logger.debug("evaluateIfMatch({}, {}) called", tag, headerValue); //$NON-NLS-1$
        EntityTagMatchHeader ifMatchHeader = null;
        try {
            ifMatchHeader = ifMatchHeaderDelegate.fromString(headerValue);
            logger.debug("ifMatchHeaderDelegate returned {}", ifMatchHeader); //$NON-NLS-1$
        } catch (IllegalArgumentException e) {
            throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
        }

        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;
View Full Code Here

Examples of org.apache.wink.common.internal.http.EntityTagMatchHeader

    /**
     * returns ResponseBuilder if any of the tags matched
     */
    private ResponseBuilder evaluateIfNoneMatch(EntityTag tag, String headerValue) {
        logger.debug("evaluateIfNoneMatch({}, {}) called", tag, headerValue); //$NON-NLS-1$
        EntityTagMatchHeader ifNoneMatchHeader = null;
        try {
            ifNoneMatchHeader = ifMatchHeaderDelegate.fromString(headerValue);
            logger.debug("ifMatchHeaderDelegate returned {}", ifNoneMatchHeader); //$NON-NLS-1$
        } catch (IllegalArgumentException e) {
            throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
        }

        if (ifNoneMatchHeader.isMatch(tag)) {
            // some tag matched
            ResponseBuilder responseBuilder = delegate.createResponseBuilder();
            String method = getMethod();
            if (method.equalsIgnoreCase("GET") || method.equalsIgnoreCase("HEAD")) { //$NON-NLS-1$ //$NON-NLS-2$
                logger
View Full Code Here

Examples of org.apache.wink.common.internal.http.EntityTagMatchHeader

        // the resource does not exist yet so any If-Match header would result
        // in a precondition failed
        String ifMatch = getHeaderValue(HttpHeaders.IF_MATCH);
        if (ifMatch != null) {
            try {
                EntityTagMatchHeader ifMatchHeader = null;
                ifMatchHeader = ifMatchHeaderDelegate.fromString(ifMatch);
                logger.debug("ifMatchHeaderDelegate returned {}", ifMatchHeader);
            } catch (IllegalArgumentException e) {
                throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
            }
View Full Code Here

Examples of org.apache.wink.common.internal.http.EntityTagMatchHeader

    /**
     * returns ResponseBuilder if none of the tags matched
     */
    private ResponseBuilder evaluateIfMatch(EntityTag tag, String headerValue) {
        logger.debug("evaluateIfMatch({}, {}) called", tag, headerValue); //$NON-NLS-1$
        EntityTagMatchHeader ifMatchHeader = null;
        try {
            ifMatchHeader = ifMatchHeaderDelegate.fromString(headerValue);
            logger.debug("ifMatchHeaderDelegate returned {}", ifMatchHeader); //$NON-NLS-1$
        } catch (IllegalArgumentException e) {
            throw new WebApplicationException(e, Response.Status.BAD_REQUEST);
        }

        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;
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.