org.carrot2.util.httpclient
Class HttpClientFactory

java.lang.Object
  extended by org.carrot2.util.httpclient.HttpClientFactory

public final class HttpClientFactory
extends Object

Prepare instances of HttpClient with desired socket configuration settings. This class takes into account two legacy Java properties:

These properties configure HTTP proxy through which all requests are tunneled (there is no need to configure per-connection proxy). No custom proxy authorization methods are implemented as of yet.


Field Summary
static int DEFAULT_TIMEOUT
          Default timeout for getTimeoutingClient() in milliseconds.
 
Method Summary
static org.apache.http.client.HttpClient getTimeoutingClient()
           
static org.apache.http.impl.client.DefaultHttpClient getTimeoutingClient(int timeout)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_TIMEOUT

public static final int DEFAULT_TIMEOUT
Default timeout for getTimeoutingClient() in milliseconds.

See Also:
Constant Field Values
Method Detail

getTimeoutingClient

public static org.apache.http.impl.client.DefaultHttpClient getTimeoutingClient(int timeout)
Parameters:
timeout - Timeout in milliseconds.
Returns:
Returns a client with sockets configured to timeout after some sensible time.

getTimeoutingClient

public static org.apache.http.client.HttpClient getTimeoutingClient()
See Also:
getTimeoutingClient(int), DEFAULT_TIMEOUT


Copyright (c) Dawid Weiss, Stanislaw Osinski