/** * Get the entity tag. * * @return the entity tag, otherwise {@code null} if not present. */ public EntityTag getEntityTag() { return singleHeader(HttpHeaders.ETAG, new Function<String, EntityTag>() { @Override public EntityTag apply(String value) { return EntityTag.valueOf(value); } }, false); }
/** * Get the entity tag. * * @return the entity tag, otherwise {@code null} if not present. */ public EntityTag getEntityTag() { return singleHeader(HttpHeaders.ETAG, new Function<String, EntityTag>() { @Override public EntityTag apply(String value) { return EntityTag.valueOf(value); } }, false); }
/** * Get message date. * * @return the message date, otherwise {@code null} if not present. */ public Date getDate() { return singleHeader(HttpHeaders.DATE, new Function<String, Date>() { @Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException ex) { throw new ProcessingException(ex); } } }, false); }
/** * Get the location. * * @return the location URI, otherwise {@code null} if not present. */ public URI getLocation() { return singleHeader(HttpHeaders.LOCATION, new Function<String, URI>() { @Override public URI apply(String value) { try { return URI.create(value); } catch (IllegalArgumentException ex) { throw new ProcessingException(ex); } } }, false); }
/** * Get Content-Length value. * * @return Content-Length as integer if present and valid number. In other cases returns -1. */ public int getLength() { return singleHeader(HttpHeaders.CONTENT_LENGTH, new Function<String, Integer>() { @Override public Integer apply(String input) { try { return (input != null && !input.isEmpty()) ? Integer.parseInt(input) : -1; } catch (NumberFormatException ex) { throw new ProcessingException(ex); } } }, true); }
/** * Get the language of the entity. * * @return the language of the entity or {@code null} if not specified. */ public Locale getLanguage() { return singleHeader(HttpHeaders.CONTENT_LANGUAGE, new Function<String, Locale>() { @Override public Locale apply(String input) { try { return new LanguageTag(input).getAsLocale(); } catch (ParseException e) { throw new ProcessingException(e); } } }, false); }
/** * Get the last modified date. * * @return the last modified date, otherwise {@code null} if not present. */ public Date getLastModified() { return singleHeader(HttpHeaders.LAST_MODIFIED, new Function<String, Date>() { @Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException e) { throw new ProcessingException(e); } } }, false); }
/** * Get Content-Length value. * * @return Content-Length as integer if present and valid number. In other cases returns -1. */ public int getLength() { return singleHeader(HttpHeaders.CONTENT_LENGTH, new Function<String, Integer>() { @Override public Integer apply(String input) { try { return (input != null && !input.isEmpty()) ? Integer.parseInt(input) : -1; } catch (NumberFormatException ex) { throw new ProcessingException(ex); } } }, true); }
/** * Get the location. * * @return the location URI, otherwise {@code null} if not present. */ public URI getLocation() { return singleHeader(HttpHeaders.LOCATION, new Function<String, URI>() { @Override public URI apply(String value) { try { return URI.create(value); } catch (IllegalArgumentException ex) { throw new ProcessingException(ex); } } }, false); }
/** * Get message date. * * @return the message date, otherwise {@code null} if not present. */ public Date getDate() { return singleHeader(HttpHeaders.DATE, new Function<String, Date>() { @Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException ex) { throw new ProcessingException(ex); } } }, false); }
/** * Get the language of the entity. * * @return the language of the entity or {@code null} if not specified. */ public Locale getLanguage() { return singleHeader(HttpHeaders.CONTENT_LANGUAGE, new Function<String, Locale>() { @Override public Locale apply(String input) { try { return new LanguageTag(input).getAsLocale(); } catch (ParseException e) { throw new ProcessingException(e); } } }, false); }
/** * Get the last modified date. * * @return the last modified date, otherwise {@code null} if not present. */ public Date getLastModified() { return singleHeader(HttpHeaders.LAST_MODIFIED, new Function<String, Date>() { @Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException e) { throw new ProcessingException(e); } } }, false); }
/** * Get the media type of the entity. * * @return the media type or {@code null} if not specified (e.g. there's no * message entity). */ public MediaType getMediaType() { return singleHeader(HttpHeaders.CONTENT_TYPE, new Function<String, MediaType>() { @Override public MediaType apply(String input) { try { return MediaType.valueOf(input); } catch (IllegalArgumentException iae) { throw new ProcessingException(iae); } } }, false); }
/** * Get the media type of the entity. * * @return the media type or {@code null} if not specified (e.g. there's no * message entity). */ public MediaType getMediaType() { return singleHeader(HttpHeaders.CONTENT_TYPE, new Function<String, MediaType>() { @Override public MediaType apply(String input) { try { return MediaType.valueOf(input); } catch (IllegalArgumentException iae) { throw new ProcessingException(iae); } } }, false); }
/** * Get the entity tag. * * @return the entity tag, otherwise {@code null} if not present. */ public EntityTag getEntityTag() { return singleHeader(HttpHeaders.ETAG, new Function<String, EntityTag>() { @Override public EntityTag apply(String value) { return EntityTag.valueOf(value); } }, false); }
/** * Get the entity tag. * * @return the entity tag, otherwise {@code null} if not present. */ public EntityTag getEntityTag() { return singleHeader(HttpHeaders.ETAG, new Function<String, EntityTag>() { @Override public EntityTag apply(String value) { return EntityTag.valueOf(value); } }, false); }
/** * Get the entity tag. * * @return the entity tag, otherwise {@code null} if not present. */ public EntityTag getEntityTag() { return singleHeader(HttpHeaders.ETAG, new Function<String, EntityTag>() { @Override public EntityTag apply(String value) { return EntityTag.valueOf(value); } }, false); }
/** * Get the entity tag. * * @return the entity tag, otherwise {@code null} if not present. */ public EntityTag getEntityTag() { return singleHeader(HttpHeaders.ETAG, new Function<String, EntityTag>() { @Override public EntityTag apply(String value) { return EntityTag.valueOf(value); } }, false); }
/** * Get the entity tag. * * @return the entity tag, otherwise {@code null} if not present. */ public EntityTag getEntityTag() { return singleHeader(HttpHeaders.ETAG, new Function<String, EntityTag>() { @Override public EntityTag apply(String value) { return EntityTag.valueOf(value); } }, false); }
/** * Get the last modified date. * * @return the last modified date, otherwise {@code null} if not present. */ public Date getLastModified() { return singleHeader(HttpHeaders.LAST_MODIFIED, new Function<String, Date>() { @Override public Date apply(String input) { try { return HttpHeaderReader.readDate(input); } catch (ParseException e) { throw new ProcessingException(e); } } }, false); }