/** * Get the allowed HTTP methods from the Allow HTTP header. * * @return the allowed HTTP methods, all methods will returned as upper case * strings. */ public Set<String> getAllowedMethods() { final String allowed = getHeaderString(HttpHeaders.ALLOW); if (allowed == null || allowed.isEmpty()) { return Collections.emptySet(); } try { return new HashSet<String>(HttpHeaderReader.readStringList(allowed.toUpperCase())); } catch (java.text.ParseException e) { throw exception(HttpHeaders.ALLOW, allowed, e); } }
/** * Get the allowed HTTP methods from the Allow HTTP header. * * @return the allowed HTTP methods, all methods will returned as upper case * strings. */ public Set<String> getAllowedMethods() { final String allowed = getHeaderString(HttpHeaders.ALLOW); if (allowed == null || allowed.isEmpty()) { return Collections.emptySet(); } try { return new HashSet<String>(HttpHeaderReader.readStringList(allowed.toUpperCase())); } catch (java.text.ParseException e) { throw exception(HttpHeaders.ALLOW, allowed, e); } }
/** * Get a list of media types that are acceptable for a request. * * @return a read-only list of requested response media types sorted according * to their q-value, with highest preference first. */ public List<AcceptableMediaType> getQualifiedAcceptableMediaTypes() { final String value = getHeaderString(HttpHeaders.ACCEPT); if (value == null || value.isEmpty()) { return WILDCARD_ACCEPTABLE_TYPE_SINGLETON_LIST; } try { return Collections.unmodifiableList(HttpHeaderReader.readAcceptMediaType(value)); } catch (ParseException e) { throw exception(HttpHeaders.ACCEPT, value, e); } }
/** * Get a list of media types that are acceptable for a request. * * @return a read-only list of requested response media types sorted according * to their q-value, with highest preference first. */ public List<AcceptableMediaType> getQualifiedAcceptableMediaTypes() { final String value = getHeaderString(HttpHeaders.ACCEPT); if (value == null || value.isEmpty()) { return WILDCARD_ACCEPTABLE_TYPE_SINGLETON_LIST; } try { return Collections.unmodifiableList(HttpHeaderReader.readAcceptMediaType(value)); } catch (ParseException e) { throw exception(HttpHeaders.ACCEPT, value, 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-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 a list of languages that are acceptable for the message. * * @return a read-only list of acceptable languages sorted according * to their q-value, with highest preference first. */ public List<AcceptableLanguageTag> getQualifiedAcceptableLanguages() { final String value = getHeaderString(HttpHeaders.ACCEPT_LANGUAGE); if (value == null || value.isEmpty()) { return Collections.singletonList(new AcceptableLanguageTag("*", null)); } try { return Collections.unmodifiableList(HttpHeaderReader.readAcceptLanguage(value)); } catch (ParseException e) { throw exception(HttpHeaders.ACCEPT_LANGUAGE, value, e); } }
/** * Get a list of languages that are acceptable for the message. * * @return a read-only list of acceptable languages sorted according * to their q-value, with highest preference first. */ public List<AcceptableLanguageTag> getQualifiedAcceptableLanguages() { final String value = getHeaderString(HttpHeaders.ACCEPT_LANGUAGE); if (value == null || value.isEmpty()) { return Collections.singletonList(new AcceptableLanguageTag("*", null)); } try { return Collections.unmodifiableList(HttpHeaderReader.readAcceptLanguage(value)); } catch (ParseException e) { throw exception(HttpHeaders.ACCEPT_LANGUAGE, value, e); } }
/** * Get the list of language tag from the "Accept-Charset" of an HTTP request. * * @return The list of AcceptableToken. This list * is ordered with the highest quality acceptable charset occurring first. */ public List<AcceptableToken> getQualifiedAcceptCharset() { final String acceptCharset = getHeaderString(HttpHeaders.ACCEPT_CHARSET); try { if (acceptCharset == null || acceptCharset.isEmpty()) { return Collections.singletonList(new AcceptableToken("*")); } return HttpHeaderReader.readAcceptToken(acceptCharset); } catch (java.text.ParseException e) { throw exception(HttpHeaders.ACCEPT_CHARSET, acceptCharset, e); } }
/** * Get the list of language tag from the "Accept-Charset" of an HTTP request. * * @return The list of AcceptableToken. This list * is ordered with the highest quality acceptable charset occurring first. */ public List<AcceptableToken> getQualifiedAcceptEncoding() { final String acceptEncoding = getHeaderString(HttpHeaders.ACCEPT_ENCODING); try { if (acceptEncoding == null || acceptEncoding.isEmpty()) { return Collections.singletonList(new AcceptableToken("*")); } return HttpHeaderReader.readAcceptToken(acceptEncoding); } catch (java.text.ParseException e) { throw exception("Accept-Encoding", acceptEncoding, e); } }
/** * Get the list of language tag from the "Accept-Charset" of an HTTP request. * * @return The list of AcceptableToken. This list * is ordered with the highest quality acceptable charset occurring first. */ public List<AcceptableToken> getQualifiedAcceptEncoding() { final String acceptEncoding = getHeaderString(HttpHeaders.ACCEPT_ENCODING); try { if (acceptEncoding == null || acceptEncoding.isEmpty()) { return Collections.singletonList(new AcceptableToken("*")); } return HttpHeaderReader.readAcceptToken(acceptEncoding); } catch (java.text.ParseException e) { throw exception("Accept-Encoding", acceptEncoding, e); } }
/** * Get the list of language tag from the "Accept-Charset" of an HTTP request. * * @return The list of AcceptableToken. This list * is ordered with the highest quality acceptable charset occurring first. */ public List<AcceptableToken> getQualifiedAcceptCharset() { final String acceptCharset = getHeaderString(HttpHeaders.ACCEPT_CHARSET); try { if (acceptCharset == null || acceptCharset.isEmpty()) { return Collections.singletonList(new AcceptableToken("*")); } return HttpHeaderReader.readAcceptToken(acceptCharset); } catch (java.text.ParseException e) { throw exception(HttpHeaders.ACCEPT_CHARSET, acceptCharset, e); } }
/** * Get the allowed HTTP methods from the Allow HTTP header. * * @return the allowed HTTP methods, all methods will returned as upper case * strings. */ public Set<String> getAllowedMethods() { final String allowed = getHeaderString(HttpHeaders.ALLOW); if (allowed == null || allowed.isEmpty()) { return Collections.emptySet(); } try { return new HashSet<String>(HttpHeaderReader.readStringList(allowed.toUpperCase())); } catch (java.text.ParseException e) { throw exception(HttpHeaders.ALLOW, allowed, 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 a list of languages that are acceptable for the message. * * @return a read-only list of acceptable languages sorted according * to their q-value, with highest preference first. */ public List<AcceptableLanguageTag> getQualifiedAcceptableLanguages() { final String value = getHeaderString(HttpHeaders.ACCEPT_LANGUAGE); if (value == null || value.isEmpty()) { return Collections.singletonList(new AcceptableLanguageTag("*", null)); } try { return Collections.unmodifiableList(HttpHeaderReader.readAcceptLanguage(value)); } catch (ParseException e) { throw exception(HttpHeaders.ACCEPT_LANGUAGE, value, e); } }
/** * Get the list of language tag from the "Accept-Charset" of an HTTP request. * * @return The list of AcceptableToken. This list * is ordered with the highest quality acceptable charset occurring first. */ public List<AcceptableToken> getQualifiedAcceptCharset() { final String acceptCharset = getHeaderString(HttpHeaders.ACCEPT_CHARSET); try { if (acceptCharset == null || acceptCharset.isEmpty()) { return Collections.singletonList(new AcceptableToken("*")); } return HttpHeaderReader.readAcceptToken(acceptCharset); } catch (java.text.ParseException e) { throw exception(HttpHeaders.ACCEPT_CHARSET, acceptCharset, e); } }
/** * Get the list of language tag from the "Accept-Charset" of an HTTP request. * * @return The list of AcceptableToken. This list * is ordered with the highest quality acceptable charset occurring first. */ public List<AcceptableToken> getQualifiedAcceptCharset() { final String acceptCharset = getHeaderString(HttpHeaders.ACCEPT_CHARSET); try { if (acceptCharset == null || acceptCharset.isEmpty()) { return Collections.singletonList(new AcceptableToken("*")); } return HttpHeaderReader.readAcceptToken(acceptCharset); } catch (java.text.ParseException e) { throw exception(HttpHeaders.ACCEPT_CHARSET, acceptCharset, e); } }