/** * Get If-Match header. * * @return the If-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfMatch() { final String ifMatch = getHeaderString(HttpHeaders.IF_MATCH); if (ifMatch == null || ifMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_MATCH, ifMatch, e); } }
/** * Get If-Match header. * * @return the If-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfMatch() { final String ifMatch = getHeaderString(HttpHeaders.IF_MATCH); if (ifMatch == null || ifMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_MATCH, ifMatch, e); } }
/** * Get If-None-Match header. * * @return the If-None-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfNoneMatch() { final String ifNoneMatch = getHeaderString(HttpHeaders.IF_NONE_MATCH); if (ifNoneMatch == null || ifNoneMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifNoneMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_NONE_MATCH, ifNoneMatch, e); } }
/** * Get If-None-Match header. * * @return the If-None-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfNoneMatch() { final String ifNoneMatch = getHeaderString(HttpHeaders.IF_NONE_MATCH); if (ifNoneMatch == null || ifNoneMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifNoneMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_NONE_MATCH, ifNoneMatch, e); } }
private Response.ResponseBuilder evaluateIfMatch(final HttpHeaders headers, final String etagValue) { String ifMatch = headers.getHeaderString(HttpHeaders.IF_MATCH); if (ifMatch == null || ifMatch.isEmpty()) { return null; } // Handle case for -gzip appended automatically (and sadly) by Apache ifMatch = ifMatch.replaceAll("-gzip", ""); try { Set<MatchingEntityTag> matchingTags = HttpHeaderReader.readMatchingEntityTag(ifMatch); MatchingEntityTag ifMatchHeader = matchingTags.iterator().next(); EntityTag eTag = new EntityTag(etagValue, ifMatchHeader.isWeak()); return matchingTags != MatchingEntityTag.ANY_MATCH && !matchingTags.contains(eTag) ? Response.status(Status.PRECONDITION_FAILED) : null; } catch (java.text.ParseException e) { return null; } }
private Response.ResponseBuilder evaluateIfMatch(final HttpHeaders headers, final String etagValue) { String ifMatch = headers.getHeaderString(HttpHeaders.IF_MATCH); if (ifMatch == null || ifMatch.isEmpty()) { return null; } // Handle case for -gzip appended automatically (and sadly) by Apache ifMatch = ifMatch.replaceAll("-gzip", ""); try { Set<MatchingEntityTag> matchingTags = HttpHeaderReader.readMatchingEntityTag(ifMatch); MatchingEntityTag ifMatchHeader = matchingTags.iterator().next(); EntityTag eTag = new EntityTag(etagValue, ifMatchHeader.isWeak()); return matchingTags != MatchingEntityTag.ANY_MATCH && !matchingTags.contains(eTag) ? Response.status(Status.PRECONDITION_FAILED) : null; } catch (java.text.ParseException e) { return null; } }
/** * Get If-Match header. * * @return the If-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfMatch() { final String ifMatch = getHeaderString(HttpHeaders.IF_MATCH); if (ifMatch == null || ifMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_MATCH, ifMatch, e); } }
/** * Get If-None-Match header. * * @return the If-None-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfNoneMatch() { final String ifNoneMatch = getHeaderString(HttpHeaders.IF_NONE_MATCH); if (ifNoneMatch == null || ifNoneMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifNoneMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_NONE_MATCH, ifNoneMatch, e); } }
/** * Get If-Match header. * * @return the If-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfMatch() { final String ifMatch = getHeaderString(HttpHeaders.IF_MATCH); if (ifMatch == null || ifMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_MATCH, ifMatch, e); } }
/** * Get If-None-Match header. * * @return the If-None-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfNoneMatch() { final String ifNoneMatch = getHeaderString(HttpHeaders.IF_NONE_MATCH); if (ifNoneMatch == null || ifNoneMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifNoneMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_NONE_MATCH, ifNoneMatch, e); } }
/** * Get If-Match header. * * @return the If-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfMatch() { final String ifMatch = getHeaderString(HttpHeaders.IF_MATCH); if (ifMatch == null || ifMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_MATCH, ifMatch, e); } }
/** * Get If-None-Match header. * * @return the If-None-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfNoneMatch() { final String ifNoneMatch = getHeaderString(HttpHeaders.IF_NONE_MATCH); if (ifNoneMatch == null || ifNoneMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifNoneMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_NONE_MATCH, ifNoneMatch, e); } }
/** * Get If-Match header. * * @return the If-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfMatch() { final String ifMatch = getHeaderString(HttpHeaders.IF_MATCH); if (ifMatch == null || ifMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_MATCH, ifMatch, e); } }
/** * Get If-None-Match header. * * @return the If-None-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfNoneMatch() { final String ifNoneMatch = getHeaderString(HttpHeaders.IF_NONE_MATCH); if (ifNoneMatch == null || ifNoneMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifNoneMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_NONE_MATCH, ifNoneMatch, e); } }
/** * Get If-Match header. * * @return the If-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfMatch() { final String ifMatch = getHeaderString(HttpHeaders.IF_MATCH); if (ifMatch == null || ifMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_MATCH, ifMatch, e); } }
/** * Get If-None-Match header. * * @return the If-None-Match header value, otherwise {@code null} if not present. */ public Set<MatchingEntityTag> getIfNoneMatch() { final String ifNoneMatch = getHeaderString(HttpHeaders.IF_NONE_MATCH); if (ifNoneMatch == null || ifNoneMatch.isEmpty()) { return null; } try { return HttpHeaderReader.readMatchingEntityTag(ifNoneMatch); } catch (java.text.ParseException e) { throw exception(HttpHeaders.IF_NONE_MATCH, ifNoneMatch, e); } }