@Override public Date getLastModified() { Object d = metadata.getFirst(HttpHeaders.LAST_MODIFIED); if (d == null) return null; if (d instanceof Date) return (Date) d; return DateUtil.parseDate(d.toString()); }
@Override public Date getDate() { Object d = metadata.getFirst(HttpHeaders.DATE); if (d == null) return null; if (d instanceof Date) return (Date) d; return DateUtil.parseDate(d.toString()); }
@Override public EntityTag getEntityTag() { Object d = metadata.getFirst(HttpHeaders.ETAG); if (d == null) return null; if (d instanceof EntityTag) return (EntityTag) d; return EntityTag.valueOf(getHeaderValueProcessor().toHeaderString(d)); }
@Override public MediaType getMediaType() { Object obj = metadata.getFirst(HttpHeaders.CONTENT_TYPE); if (obj instanceof MediaType) return (MediaType) obj; if (obj == null) return null; return MediaType.valueOf(getHeaderValueProcessor().toHeaderString(obj)); }
@Override public int getLength() { Object obj = metadata.getFirst(HttpHeaders.CONTENT_LANGUAGE); if (obj == null) return -1; if (obj instanceof Integer) return (Integer) obj; return Integer.valueOf(getHeaderValueProcessor().toHeaderString(obj)); }
@Override public Locale getLanguage() { Object obj = metadata.getFirst(HttpHeaders.CONTENT_LANGUAGE); if (obj == null) return null; if (obj instanceof Locale) return (Locale) obj; return new Locale(obj.toString()); }
@Override public URI getLocation() { Object uri = metadata.getFirst(HttpHeaders.LOCATION); if (uri == null) return null; if (uri instanceof URI) return (URI) uri; String str = null; if (uri instanceof String) str = (String) uri; else str = getHeaderValueProcessor().toHeaderString(uri); return URI.create(str); }