/** * contentType getter * * @return the mime-type of response */ public String getContentType() { if (contentType == null && headers != null) { contentType = getHeaderValue(CONTENT_TYPE); } return contentType; }
/** * location getter * * @return the location of a related resource */ public URI getLocation() { if (location == null && headers != null) { // Retrieve the value from the location header if available final String value = getHeaderValue(LOCATION); if (value != null) { location = URI.create(getHeaderValue(LOCATION)); } // Fall back to retrieving from the described by link if (location == null) { final List<URI> links = getLinkHeaders(DESCRIBEDBY_REL); if (links != null && links.size() == 1) { location = links.get(0); } } } return location; }
String etag = response.getHeaderValue(ETAG_HEADER); if (etag!=null && etag.contains(ETAG_WEAK_PREFIX)) { etag = etag.replace(ETAG_WEAK_PREFIX, "");
String etag = response.getHeaderValue(ETAG_HEADER); if (etag!=null && etag.contains(ETAG_WEAK_PREFIX)) { etag = etag.replace(ETAG_WEAK_PREFIX, "");