public class HttpClientManager extends Object
| Constructor and Description |
|---|
HttpClientManager() |
| Modifier and Type | Method and Description |
|---|---|
static long |
appendUrlContentsToFile(HTTPSession session,
String urlencoded,
File file,
long start,
long end) |
static void |
clearState() |
static void |
copyUrlContentsToFile(HTTPSession session,
String urlencoded,
File file) |
static String |
getContentAsString(HTTPSession session,
String urlencoded)
Get the content from a url.
|
static String |
getUrlContentsAsString(HTTPSession session,
String urlencoded,
int maxKbytes) |
static void |
init(org.apache.commons.httpclient.auth.CredentialsProvider provider,
String userAgent)
initialize the HttpClient layer.
|
static void |
main(String[] args) |
static int |
putContent(String urlencoded,
String content)
Put content to a url, using HTTP PUT.
|
static void |
showHttpRequestInfo(Formatter f,
org.apache.commons.httpclient.HttpMethodBase m) |
static void |
showHttpResponseInfo(Formatter f,
org.apache.commons.httpclient.HttpMethodBase m) |
public static void init(org.apache.commons.httpclient.auth.CredentialsProvider provider,
String userAgent)
provider - CredentialsProvider.userAgent - Content of User-Agent header, may be nullpublic static void clearState()
public static String getContentAsString(HTTPSession session, String urlencoded) throws IOException
session - use this session, if null, create a new oneurlencoded - url as a StringIOException - on errorpublic static int putContent(String urlencoded, String content) throws IOException
urlencoded - url as a Stringcontent - PUT this content at the given url.IOException - on errorpublic static String getUrlContentsAsString(HTTPSession session, String urlencoded, int maxKbytes)
public static void copyUrlContentsToFile(HTTPSession session, String urlencoded, File file) throws HTTPException
HTTPExceptionpublic static long appendUrlContentsToFile(HTTPSession session, String urlencoded, File file, long start, long end) throws HTTPException
HTTPExceptionpublic static void showHttpRequestInfo(Formatter f, org.apache.commons.httpclient.HttpMethodBase m)
public static void showHttpResponseInfo(Formatter f, org.apache.commons.httpclient.HttpMethodBase m)
public static void main(String[] args) throws IOException
IOExceptionCopyright © 1999-2012 UCAR/Unidata. All Rights Reserved.