org.olat.core.util.httpclient
Class HttpClientFactory

java.lang.Object
  extended by org.olat.core.util.httpclient.HttpClientFactory

public class HttpClientFactory
extends java.lang.Object

Description:

The HttpClientFactory creates multithreaded jakarta commons HttpClients that feature SSL capability with support for unsigned SSL certificates.
When using HttpClient in OLAT you must use this factory and never use new HttpClient() directly since this would not be thread save.

Initial Date: 21.03.2007

Author:
Florian Gnägi, frentix GmbH, http://www.frentix.com

Constructor Summary
HttpClientFactory()
           
 
Method Summary
static org.apache.commons.httpclient.HttpClient getHttpClientInstance()
          A HttpClient without basic authentication and no host or port setting.
static org.apache.commons.httpclient.HttpClient getHttpClientInstance(java.lang.String host, int port, java.lang.String protocol, java.lang.String user, java.lang.String password)
          A HttpClient with basic authentication and host or port setting.
static org.apache.commons.httpclient.HttpClient getHttpClientInstance(java.lang.String user, java.lang.String password)
          A HttpClient with basic authentication and no host or port setting.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpClientFactory

public HttpClientFactory()
Method Detail

getHttpClientInstance

public static org.apache.commons.httpclient.HttpClient getHttpClientInstance()
A HttpClient without basic authentication and no host or port setting. Can only be used to retrieve absolute URLs

Returns:
HttpClient

getHttpClientInstance

public static org.apache.commons.httpclient.HttpClient getHttpClientInstance(java.lang.String user,
                                                                             java.lang.String password)
A HttpClient with basic authentication and no host or port setting. Can only be used to retrieve absolute URLs

Parameters:
user - can be NULL
password - can be NULL
Returns:
HttpClient

getHttpClientInstance

public static org.apache.commons.httpclient.HttpClient getHttpClientInstance(java.lang.String host,
                                                                             int port,
                                                                             java.lang.String protocol,
                                                                             java.lang.String user,
                                                                             java.lang.String password)
A HttpClient with basic authentication and host or port setting. Can only be used to retrieve relative URLs

Parameters:
host - must not be NULL
port - must not be NULL
protocol - must not be NULL
user - can be NULL
password - can be NULL
Returns:
HttpClient