public class HttpUtil
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.text.SimpleDateFormat |
HTTP_DATE_FORMAT |
Constructor and Description |
---|
HttpUtil() |
Modifier and Type | Method and Description |
---|---|
static long |
getContentLength(org.apache.http.HttpResponse response)
Get the content length from the headers in the response.
|
static java.lang.String |
getContentType(org.apache.http.HttpResponse response)
Get the content type of the content from the headers
in the response.
|
static java.util.Date |
getDate(org.apache.http.HttpResponse response,
java.lang.String header,
java.util.Date defaultValue) |
static java.util.Date |
getLastModified(org.apache.http.HttpResponse response)
Get the date the content was last modified from the headers
in the response.
|
static java.lang.Long |
getLong(org.apache.http.HttpResponse response,
java.lang.String header,
java.lang.Long defaultValue) |
static java.lang.String |
getString(org.apache.http.HttpResponse response,
java.lang.String header,
java.lang.String defaultValue) |
static void |
shutdown(org.apache.http.client.HttpClient client)
Safely shuts down a http client and it's connection manager
without trowing an exception.
|
public static long getContentLength(org.apache.http.HttpResponse response)
response
- The response from a HTTP requestpublic static java.util.Date getLastModified(org.apache.http.HttpResponse response)
response
- The response from a HTTP requestpublic static java.lang.String getContentType(org.apache.http.HttpResponse response)
response
- The response from a HTTP requestpublic static java.lang.String getString(org.apache.http.HttpResponse response, java.lang.String header, java.lang.String defaultValue)
public static java.lang.Long getLong(org.apache.http.HttpResponse response, java.lang.String header, java.lang.Long defaultValue)
public static java.util.Date getDate(org.apache.http.HttpResponse response, java.lang.String header, java.util.Date defaultValue)
public static void shutdown(org.apache.http.client.HttpClient client)