public class HttpHeaderParser
extends java.lang.Object
Constructor and Description |
---|
HttpHeaderParser() |
Modifier and Type | Method and Description |
---|---|
static Cache.Entry |
parseCacheHeaders(NetworkResponse response)
Extracts a
Cache.Entry from a NetworkResponse . |
static java.lang.String |
parseCharset(java.util.Map<java.lang.String,java.lang.String> headers)
Returns the charset specified in the Content-Type of this header,
or the HTTP default (ISO-8859-1) if none can be found.
|
static java.lang.String |
parseCharset(java.util.Map<java.lang.String,java.lang.String> headers,
java.lang.String defaultCharset)
Retrieve a charset from headers
|
static long |
parseDateAsEpoch(java.lang.String dateStr)
Parse date in RFC1123 format, and return its value as epoch
|
public static Cache.Entry parseCacheHeaders(NetworkResponse response)
Cache.Entry
from a NetworkResponse
.response
- The network response to parse headers frompublic static long parseDateAsEpoch(java.lang.String dateStr)
public static java.lang.String parseCharset(java.util.Map<java.lang.String,java.lang.String> headers, java.lang.String defaultCharset)
headers
- An Map
of headersdefaultCharset
- Charset to return if none can be foundpublic static java.lang.String parseCharset(java.util.Map<java.lang.String,java.lang.String> headers)