public class HttpHeaderParser extends 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 String |
parseCharset(Map<String,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 String |
parseCharset(Map<String,String> headers,
String defaultCharset)
Retrieve a charset from headers
|
static long |
parseDateAsEpoch(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(String dateStr)
public static String parseCharset(Map<String,String> headers, String defaultCharset)
headers
- An Map
of headersdefaultCharset
- Charset to return if none can be found