ucar.nc2.dataset
Class HttpClientManager

java.lang.Object
  extended by ucar.nc2.dataset.HttpClientManager

public class HttpClientManager
extends java.lang.Object

Manage Http Client protocol settings.

 Example:
   org.apache.commons.httpclient.auth.CredentialsProvider provider = new thredds.ui.UrlAuthenticatorDialog(frame);
 ucar.nc2.dataset.HttpClientManager.init(provider, "ToolsUI");
 

Version:
$Revision$ $Date$
Author:
caron

Constructor Summary
HttpClientManager()
           
 
Method Summary
static void clearState()
           
static java.lang.String getContent(java.lang.String urlString)
          COnvenience better to use getResponseAsStream
static org.apache.commons.httpclient.HttpClient getHttpClient()
          Get the HttpClient object - a single instance is used.
static void init(org.apache.commons.httpclient.auth.CredentialsProvider provider, java.lang.String userAgent)
          initialize the HttpClient layer.
static int putContent(java.lang.String urlString, java.lang.String content)
           
static void setHttpClient(org.apache.commons.httpclient.HttpClient client)
          Set the HttpClient object - a single instance is used.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientManager

public HttpClientManager()
Method Detail

init

public static void init(org.apache.commons.httpclient.auth.CredentialsProvider provider,
                        java.lang.String userAgent)
initialize the HttpClient layer.

Parameters:
provider - CredentialsProvider.
userAgent - Content of User-Agent header, may be null

setHttpClient

public static void setHttpClient(org.apache.commons.httpclient.HttpClient client)
Set the HttpClient object - a single instance is used. Propaget to entire NetcdfJava library.


getHttpClient

public static org.apache.commons.httpclient.HttpClient getHttpClient()
Get the HttpClient object - a single instance is used.


clearState

public static void clearState()

getContent

public static java.lang.String getContent(java.lang.String urlString)
                                   throws java.io.IOException
COnvenience better to use getResponseAsStream

Throws:
java.io.IOException

putContent

public static int putContent(java.lang.String urlString,
                             java.lang.String content)
                      throws java.io.IOException
Throws:
java.io.IOException