code: protected String getCharsetFromHeaders(HttpHeaders headers) 
  	throws IOException {
  		if(headers == null) {
  			return null;
  		}
  		for(HttpHeader header : headers) {
  			if(header.getName().toUpperCase().trim().equals(
  					HTTP_CONTENT_TYPE_HEADER)) {
  				return contentTypeToCharset(header.getValue());
  			}
  		}
  		return null;
  	}
docs: Attempt to divine the character encoding of the document from the
  Content-Type HTTP header (with a "charset=")
  
  @param resource
  @return String character set found or null if the header was not present
  @throws IOException