|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.nc2.util.net.HttpClientManager
public class HttpClientManager
Convenience routines that wrap HTTPSession.
Constructor Summary | |
---|---|
HttpClientManager()
|
Method Summary | |
---|---|
static long |
appendUrlContentsToFile(HTTPSession session,
String urlString,
File file,
long start,
long end)
|
static void |
clearState()
|
static void |
copyUrlContentsToFile(HTTPSession session,
String urlString,
File file)
|
static String |
getContentAsString(HTTPSession session,
String urlString)
Get the content from a url. |
static String |
getUrlContentsAsString(HTTPSession session,
String urlString,
int maxKbytes)
|
static void |
init(org.apache.commons.httpclient.auth.CredentialsProvider provider,
String userAgent)
initialize the HttpClient layer. |
static int |
putContent(String urlString,
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpClientManager()
Method Detail |
---|
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 urlString) throws IOException
session
- use this session, if null, create a new oneurlString
- url as a String
IOException
- on errorpublic static int putContent(String urlString, String content) throws IOException
urlString
- url as a Stringcontent
- PUT this content at the given url.
IOException
- on errorpublic static String getUrlContentsAsString(HTTPSession session, String urlString, int maxKbytes)
public static void copyUrlContentsToFile(HTTPSession session, String urlString, File file) throws HTTPException
HTTPException
public static long appendUrlContentsToFile(HTTPSession session, String urlString, File file, long start, long end) throws HTTPException
HTTPException
public static void showHttpRequestInfo(Formatter f, org.apache.commons.httpclient.HttpMethodBase m)
public static void showHttpResponseInfo(Formatter f, org.apache.commons.httpclient.HttpMethodBase m)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |