diff --git a/httpclient/src/main/java/org/apache/http/client/AuthenticationHandler.java b/httpclient/src/main/java/org/apache/http/client/AuthenticationHandler.java index 5dc4f6a74..911e1a461 100644 --- a/httpclient/src/main/java/org/apache/http/client/AuthenticationHandler.java +++ b/httpclient/src/main/java/org/apache/http/client/AuthenticationHandler.java @@ -41,19 +41,59 @@ import org.apache.http.auth.MalformedChallengeException; import org.apache.http.protocol.HttpContext; /** +/** + * A handler for determining if an HTTP response represents an authentication + * challenge that was sent back to the client as a result of authentication + * failure. + *

+ * Implementations of this interface must be thread-safe. Access to shared + * data must be synchronized as methods of this interface may be executed + * from multiple threads. * * @since 4.0 */ public interface AuthenticationHandler { + /** + * Determines if the given HTTP response response represents + * an authentication challenge that was sent back as a result + * of authentication failure + * @param response HTTP response. + * @param context HTTP context. + * @return true if user authentication is required, + * false otherwise. + */ boolean isAuthenticationRequested( HttpResponse response, HttpContext context); - + + /** + * Extracts from the given HTTP response a collection of authentication + * challenges, each of which represents an authentication scheme supported + * by the authentication host. + * + * @param response HTTP response. + * @param context HTTP context. + * @return a collection of challenges keyed by names of corresponding + * authentication schemes. + * @throws MalformedChallengeException if one of the authentication + * challenges is not valid or malformed. + */ Map getChallenges( HttpResponse response, HttpContext context) throws MalformedChallengeException; + /** + * Selects one authentication challenge out of all available and + * creates and generates {@link AuthScheme} instance capable of + * processing that challenge. + * @param challenges collection of challenges. + * @param response HTTP response. + * @param context HTTP context. + * @return authentication scheme to use for authentication. + * @throws AuthenticationException if an authentication scheme + * could not be selected. + */ AuthScheme selectScheme( Map challenges, HttpResponse response, diff --git a/httpclient/src/main/java/org/apache/http/client/CredentialsProvider.java b/httpclient/src/main/java/org/apache/http/client/CredentialsProvider.java index 8288ca0e4..8d8d105fa 100644 --- a/httpclient/src/main/java/org/apache/http/client/CredentialsProvider.java +++ b/httpclient/src/main/java/org/apache/http/client/CredentialsProvider.java @@ -34,8 +34,12 @@ import org.apache.http.auth.AuthScope; import org.apache.http.auth.Credentials; /** - * Abstract credentials provider. - * + * Abstract credentials provider that maintains a collection of user + * credentials. + *

+ * Implementations of this interface must be thread-safe. Access to shared + * data must be synchronized as methods of this interface may be executed + * from multiple threads. * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/client/HttpClient.java b/httpclient/src/main/java/org/apache/http/client/HttpClient.java index e00c16f3d..00674e716 100644 --- a/httpclient/src/main/java/org/apache/http/client/HttpClient.java +++ b/httpclient/src/main/java/org/apache/http/client/HttpClient.java @@ -42,15 +42,14 @@ import org.apache.http.params.HttpParams; import org.apache.http.protocol.HttpContext; /** - * Interface for an HTTP client. - * HTTP clients act as a facade to a number of objects required to - * execute HTTP requests while handling cookies, authentication, - * connection management, and other features. - * Thread safety of HTTP clients depends on the implementation - * and configuration of the specific client. + * This interface represents only the most basic contract for HTTP request + * execution. It imposes no restrictions or particular details on the request + * execution process and leaves the specifics of state management, + * authentication and redirect handling up to individual implementations. + * This should make it easier to decorate the interface with additional + * functionality such as response content caching. *

- * The usual execution flow can be demonstrated by the - * code snippet below: + * The usual execution flow can be demonstrated by the code snippet below: *

  * HttpClient httpclient = new DefaultHttpClient();
  * 
@@ -100,11 +99,6 @@ import org.apache.http.protocol.HttpContext;
  * }
  * 
* - * - * - * - * @version $Revision$ - * * @since 4.0 */ public interface HttpClient { @@ -118,17 +112,14 @@ public interface HttpClient { * * @return the default parameters */ - HttpParams getParams() - ; - + HttpParams getParams(); /** * Obtains the connection manager used by this client. * * @return the connection manager */ - ClientConnectionManager getConnectionManager() - ; + ClientConnectionManager getConnectionManager(); /** * Executes a request using the default context. @@ -144,9 +135,7 @@ public interface HttpClient { * @throws ClientProtocolException in case of an http protocol error */ HttpResponse execute(HttpUriRequest request) - throws IOException, ClientProtocolException - ; - + throws IOException, ClientProtocolException; /** * Executes a request using the given context. @@ -165,9 +154,7 @@ public interface HttpClient { * @throws ClientProtocolException in case of an http protocol error */ HttpResponse execute(HttpUriRequest request, HttpContext context) - throws IOException, ClientProtocolException - ; - + throws IOException, ClientProtocolException; /** * Executes a request to the target using the default context. @@ -187,8 +174,7 @@ public interface HttpClient { * @throws ClientProtocolException in case of an http protocol error */ HttpResponse execute(HttpHost target, HttpRequest request) - throws IOException, ClientProtocolException - ; + throws IOException, ClientProtocolException; /** * Executes a request to the target using the given context. @@ -211,8 +197,7 @@ public interface HttpClient { */ HttpResponse execute(HttpHost target, HttpRequest request, HttpContext context) - throws IOException, ClientProtocolException - ; + throws IOException, ClientProtocolException; /** * Executes a request using the default context and processes the @@ -228,8 +213,7 @@ public interface HttpClient { T execute( HttpUriRequest request, ResponseHandler responseHandler) - throws IOException, ClientProtocolException - ; + throws IOException, ClientProtocolException; /** * Executes a request using the given context and processes the @@ -246,8 +230,7 @@ public interface HttpClient { HttpUriRequest request, ResponseHandler responseHandler, HttpContext context) - throws IOException, ClientProtocolException - ; + throws IOException, ClientProtocolException; /** * Executes a request to the target using the default context and @@ -268,8 +251,7 @@ public interface HttpClient { HttpHost target, HttpRequest request, ResponseHandler responseHandler) - throws IOException, ClientProtocolException - ; + throws IOException, ClientProtocolException; /** * Executes a request to the target using the given context and @@ -293,7 +275,6 @@ public interface HttpClient { HttpRequest request, ResponseHandler responseHandler, HttpContext context) - throws IOException, ClientProtocolException - ; + throws IOException, ClientProtocolException; -} // interface HttpClient +} diff --git a/httpclient/src/main/java/org/apache/http/client/HttpRequestRetryHandler.java b/httpclient/src/main/java/org/apache/http/client/HttpRequestRetryHandler.java index e2e6f70a7..30408890b 100644 --- a/httpclient/src/main/java/org/apache/http/client/HttpRequestRetryHandler.java +++ b/httpclient/src/main/java/org/apache/http/client/HttpRequestRetryHandler.java @@ -38,12 +38,10 @@ import org.apache.http.protocol.HttpContext; /** * A handler for determining if an HttpRequest should be retried after a * recoverable exception during execution. - * *

- * Classes implementing this interface must synchronize access to shared - * data as methods of this interfrace may be executed from multiple threads - *

- * + * Implementations of this interface must be thread-safe. Access to shared + * data must be synchronized as methods of this interface may be executed + * from multiple threads. * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/client/RedirectHandler.java b/httpclient/src/main/java/org/apache/http/client/RedirectHandler.java index 05c3a0eee..c9b6fd36c 100644 --- a/httpclient/src/main/java/org/apache/http/client/RedirectHandler.java +++ b/httpclient/src/main/java/org/apache/http/client/RedirectHandler.java @@ -41,12 +41,10 @@ import org.apache.http.protocol.HttpContext; * A handler for determining if an HTTP request should be redirected to * a new location in response to an HTTP response received from the target * server. - * *

- * Classes implementing this interface must synchronize access to shared - * data as methods of this interfrace may be executed from multiple threads - *

- * + * Implementations of this interface must be thread-safe. Access to shared + * data must be synchronized as methods of this interface may be executed + * from multiple threads. * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/client/RequestDirector.java b/httpclient/src/main/java/org/apache/http/client/RequestDirector.java index 5b32ec571..03b67a481 100644 --- a/httpclient/src/main/java/org/apache/http/client/RequestDirector.java +++ b/httpclient/src/main/java/org/apache/http/client/RequestDirector.java @@ -46,17 +46,6 @@ import org.apache.http.protocol.HttpContext; * authentication challenges. The director may therefore generate and * send a sequence of requests in order to execute one initial request. * - *
Note: - * It is most likely that implementations of this interface will - * allocate connections, and return responses that depend on those - * connections for reading the response entity. Such connections - * MUST be released, but that is out of the scope of a request director. - * - * - * - * - * @version $Revision$ - * * @since 4.0 */ public interface RequestDirector { @@ -83,9 +72,7 @@ public interface RequestDirector { * @throws IOException in case of an IO problem * or if the connection was aborted */ - HttpResponse execute(HttpHost target, HttpRequest request, - HttpContext context) - throws HttpException, IOException - ; + HttpResponse execute(HttpHost target, HttpRequest request, HttpContext context) + throws HttpException, IOException; -} // class ClientRequestDirector +} diff --git a/httpclient/src/main/java/org/apache/http/client/entity/package.html b/httpclient/src/main/java/org/apache/http/client/entity/package.html new file mode 100644 index 000000000..e2e64dadf --- /dev/null +++ b/httpclient/src/main/java/org/apache/http/client/entity/package.html @@ -0,0 +1,40 @@ + + + + + +Additional HTTP entity implementations that depend on HttpClient +specific features. + + diff --git a/httpclient/src/main/java/org/apache/http/client/methods/HttpEntityEnclosingRequestBase.java b/httpclient/src/main/java/org/apache/http/client/methods/HttpEntityEnclosingRequestBase.java index 46826ebc9..dbd55f295 100644 --- a/httpclient/src/main/java/org/apache/http/client/methods/HttpEntityEnclosingRequestBase.java +++ b/httpclient/src/main/java/org/apache/http/client/methods/HttpEntityEnclosingRequestBase.java @@ -38,10 +38,8 @@ import org.apache.http.client.utils.CloneUtils; import org.apache.http.protocol.HTTP; /** - * Basic implementation of an HTTP request that can be modified. - * - * - * @version $Revision$ + * Basic implementation of an entity enclosing HTTP request + * that can be modified * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/client/package.html b/httpclient/src/main/java/org/apache/http/client/package.html index 4573a1080..fa7e02e4f 100644 --- a/httpclient/src/main/java/org/apache/http/client/package.html +++ b/httpclient/src/main/java/org/apache/http/client/package.html @@ -34,8 +34,7 @@ --> -The API for client-side HTTP communication and -entry point to the HttpClient module. +The API for client-side HTTP communication.

The usual execution flow can be demonstrated by the code snippet below: diff --git a/httpclient/src/main/java/org/apache/http/client/params/AuthPolicy.java b/httpclient/src/main/java/org/apache/http/client/params/AuthPolicy.java index 7dbfff9cf..b562d0fd4 100644 --- a/httpclient/src/main/java/org/apache/http/client/params/AuthPolicy.java +++ b/httpclient/src/main/java/org/apache/http/client/params/AuthPolicy.java @@ -34,6 +34,7 @@ package org.apache.http.client.params; import net.jcip.annotations.Immutable; /** + * Standard authentication schemes supported by HttpClient. * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/client/params/ClientPNames.java b/httpclient/src/main/java/org/apache/http/client/params/ClientPNames.java index 33c307b82..36ecb35df 100644 --- a/httpclient/src/main/java/org/apache/http/client/params/ClientPNames.java +++ b/httpclient/src/main/java/org/apache/http/client/params/ClientPNames.java @@ -30,13 +30,8 @@ package org.apache.http.client.params; - /** - * Parameter names for the HttpClient module. - * This does not include parameters for informational units - * HttpAuth, HttpCookie, or HttpConn. - * - * @version $Revision$ + * Parameter names for HTTP client parameters. * * @since 4.0 */ @@ -51,11 +46,9 @@ public interface ClientPNames { public static final String CONNECTION_MANAGER_FACTORY_CLASS_NAME = "http.connection-manager.factory-class-name"; /** - * Defines the factory to create a default {@link org.apache.http.conn.ClientConnectionManager}. - *

- * This parameters expects a value of type {@link org.apache.http.conn.ClientConnectionManagerFactory}. - *

+ * @deprecated use #CONNECTION_MANAGER_FACTORY_CLASS_NAME */ + @Deprecated public static final String CONNECTION_MANAGER_FACTORY = "http.connection-manager.factory-object"; /** @@ -110,7 +103,8 @@ public interface ClientPNames { public static final String COOKIE_POLICY = "http.protocol.cookie-policy"; /** - * Defines the virtual host name. + * Defines the virtual host name to be used in the Host + * request header instead of the physical host name. *

* This parameter expects a value of type {@link org.apache.http.HttpHost}. *

diff --git a/httpclient/src/main/java/org/apache/http/client/params/ClientParamBean.java b/httpclient/src/main/java/org/apache/http/client/params/ClientParamBean.java index 90abdba3b..6a9171b2e 100644 --- a/httpclient/src/main/java/org/apache/http/client/params/ClientParamBean.java +++ b/httpclient/src/main/java/org/apache/http/client/params/ClientParamBean.java @@ -59,6 +59,7 @@ public class ClientParamBean extends HttpAbstractParamBean { params.setParameter(ClientPNames.CONNECTION_MANAGER_FACTORY_CLASS_NAME, factory); } + @Deprecated public void setConnectionManagerFactory(ClientConnectionManagerFactory factory) { params.setParameter(ClientPNames.CONNECTION_MANAGER_FACTORY, factory); } diff --git a/httpclient/src/main/java/org/apache/http/client/params/package.html b/httpclient/src/main/java/org/apache/http/client/params/package.html index fc4b46bbc..b3c1047cd 100644 --- a/httpclient/src/main/java/org/apache/http/client/params/package.html +++ b/httpclient/src/main/java/org/apache/http/client/params/package.html @@ -34,7 +34,6 @@ --> -Parameters for configuring HttpClient. - +Parameters for configuring the default HttpClient implementation. diff --git a/httpclient/src/main/java/org/apache/http/conn/ClientConnectionManager.java b/httpclient/src/main/java/org/apache/http/conn/ClientConnectionManager.java index 24db6a8c6..ce0533a81 100644 --- a/httpclient/src/main/java/org/apache/http/conn/ClientConnectionManager.java +++ b/httpclient/src/main/java/org/apache/http/conn/ClientConnectionManager.java @@ -42,6 +42,10 @@ import org.apache.http.conn.scheme.SchemeRegistry; * HTTP connections, manage persistent connections and synchronize access to * persistent connections making sure that only one thread of execution can * have access to a connection at a time. + *

+ * Implementations of this interface must be thread-safe. Access to shared + * data must be synchronized as methods of this interface may be executed + * from multiple threads. * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/conn/ClientConnectionOperator.java b/httpclient/src/main/java/org/apache/http/conn/ClientConnectionOperator.java index 9f9b9e72c..aaa4a1960 100644 --- a/httpclient/src/main/java/org/apache/http/conn/ClientConnectionOperator.java +++ b/httpclient/src/main/java/org/apache/http/conn/ClientConnectionOperator.java @@ -45,10 +45,14 @@ import org.apache.http.protocol.HttpContext; * {@link OperatedClientConnection} instances and updating the underlying * {@link Socket} of those objects. Implementations will most likely make use * of {@link SocketFactory}s to create {@link Socket} instances. - *
+ *

* The methods in this interface allow the creation of plain and layered * sockets. Creating a tunnelled connection through a proxy, however, * is not within the scope of the operator. + *

+ * Implementations of this interface must be thread-safe. Access to shared + * data must be synchronized as methods of this interface may be executed + * from multiple threads. * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/conn/ConnectionKeepAliveStrategy.java b/httpclient/src/main/java/org/apache/http/conn/ConnectionKeepAliveStrategy.java index 15c844499..467e36604 100644 --- a/httpclient/src/main/java/org/apache/http/conn/ConnectionKeepAliveStrategy.java +++ b/httpclient/src/main/java/org/apache/http/conn/ConnectionKeepAliveStrategy.java @@ -37,6 +37,10 @@ import org.apache.http.protocol.HttpContext; /** * Interface for deciding how long a connection can remain * idle before being reused. + *

+ * Implementations of this interface must be thread-safe. Access to shared + * data must be synchronized as methods of this interface may be executed + * from multiple threads. * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoutePlanner.java b/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoutePlanner.java index a8eb7f9f8..5fdca91bc 100644 --- a/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoutePlanner.java +++ b/httpclient/src/main/java/org/apache/http/conn/routing/HttpRoutePlanner.java @@ -40,6 +40,10 @@ import org.apache.http.protocol.HttpContext; * Encapsulates logic to compute a {@link HttpRoute} to a target host. * Implementations may for example be based on parameters, or on the * standard Java system properties. + *

+ * Implementations of this interface must be thread-safe. Access to shared + * data must be synchronized as methods of this interface may be executed + * from multiple threads. * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/impl/client/AbstractAuthenticationHandler.java b/httpclient/src/main/java/org/apache/http/impl/client/AbstractAuthenticationHandler.java index e187c5989..92e005c5e 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/AbstractAuthenticationHandler.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/AbstractAuthenticationHandler.java @@ -57,6 +57,7 @@ import org.apache.http.protocol.HttpContext; import org.apache.http.util.CharArrayBuffer; /** + * Base class for {@link AuthenticationHandler} implementations. * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java index fbffe7cfd..c49ccfe3b 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/AbstractHttpClient.java @@ -71,11 +71,67 @@ import org.apache.http.protocol.HttpProcessor; import org.apache.http.protocol.HttpRequestExecutor; /** - * Convenience base class for HTTP client implementations. - * - * - * - * @version $Revision$ + * Base class for {@link HttpClient} implementations. + *

+ * This class maintains a number of objects used during HTTP request execution + * and provides a number of factory methods to instantiate those objects: + *

* * @since 4.0 */ @@ -458,8 +514,6 @@ public abstract class AbstractHttpClient implements HttpClient { getHttpProcessor().removeRequestInterceptorByClass(clazz); } - - // non-javadoc, see interface HttpClient public final HttpResponse execute(HttpUriRequest request) throws IOException, ClientProtocolException { @@ -503,15 +557,12 @@ public abstract class AbstractHttpClient implements HttpClient { return target; } - // non-javadoc, see interface HttpClient public final HttpResponse execute(HttpHost target, HttpRequest request) throws IOException, ClientProtocolException { return execute(target, request, (HttpContext) null); } - - // non-javadoc, see interface HttpClient public final HttpResponse execute(HttpHost target, HttpRequest request, HttpContext context) throws IOException, ClientProtocolException { @@ -557,9 +608,8 @@ public abstract class AbstractHttpClient implements HttpClient { } catch(HttpException httpException) { throw new ClientProtocolException(httpException); } - } // execute + } - protected RequestDirector createClientRequestDirector( final HttpRequestExecutor requestExec, final ClientConnectionManager conman, @@ -608,8 +658,6 @@ public abstract class AbstractHttpClient implements HttpClient { (null, getParams(), req.getParams(), null); } - - // non-javadoc, see interface HttpClient public T execute( final HttpUriRequest request, final ResponseHandler responseHandler) @@ -617,8 +665,6 @@ public abstract class AbstractHttpClient implements HttpClient { return execute(request, responseHandler, null); } - - // non-javadoc, see interface HttpClient public T execute( final HttpUriRequest request, final ResponseHandler responseHandler, @@ -628,8 +674,6 @@ public abstract class AbstractHttpClient implements HttpClient { return execute(target, request, responseHandler, context); } - - // non-javadoc, see interface HttpClient public T execute( final HttpHost target, final HttpRequest request, @@ -638,8 +682,6 @@ public abstract class AbstractHttpClient implements HttpClient { return execute(target, request, responseHandler, null); } - - // non-javadoc, see interface HttpClient public T execute( final HttpHost target, final HttpRequest request, @@ -694,5 +736,4 @@ public abstract class AbstractHttpClient implements HttpClient { return result; } - -} // class AbstractHttpClient +} diff --git a/httpclient/src/main/java/org/apache/http/impl/client/ClientParamsStack.java b/httpclient/src/main/java/org/apache/http/impl/client/ClientParamsStack.java index f1facb0fa..16838ac06 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/ClientParamsStack.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/ClientParamsStack.java @@ -31,7 +31,6 @@ package org.apache.http.impl.client; - import net.jcip.annotations.NotThreadSafe; import org.apache.commons.logging.Log; @@ -39,7 +38,6 @@ import org.apache.commons.logging.LogFactory; import org.apache.http.params.HttpParams; import org.apache.http.params.AbstractHttpParams; - /** * Represents a stack of parameter collections. * When retrieving a parameter, the stack is searched in a fixed order diff --git a/httpclient/src/main/java/org/apache/http/impl/client/DefaultConnectionKeepAliveStrategy.java b/httpclient/src/main/java/org/apache/http/impl/client/DefaultConnectionKeepAliveStrategy.java index d4406eace..154e2752a 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/DefaultConnectionKeepAliveStrategy.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/DefaultConnectionKeepAliveStrategy.java @@ -46,9 +46,6 @@ import org.apache.http.protocol.HttpContext; * * The default implementation looks solely at the 'Keep-Alive' * header's timeout token. - * - * - * @version $Revision: $ * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java b/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java index db5a2d1aa..f7e4fbfce 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/DefaultHttpClient.java @@ -182,27 +182,21 @@ public class DefaultHttpClient extends AbstractHttpClient { ClientConnectionManagerFactory factory = null; - // Try first getting the factory directly as an object. - factory = (ClientConnectionManagerFactory) params - .getParameter(ClientPNames.CONNECTION_MANAGER_FACTORY); - if (factory == null) { // then try getting its class name. - String className = (String) params.getParameter( - ClientPNames.CONNECTION_MANAGER_FACTORY_CLASS_NAME); - if (className != null) { - try { - Class clazz = Class.forName(className); - factory = (ClientConnectionManagerFactory) clazz.newInstance(); - } catch (ClassNotFoundException ex) { - throw new IllegalStateException("Invalid class name: " + className); - } catch (IllegalAccessException ex) { - throw new IllegalAccessError(ex.getMessage()); - } catch (InstantiationException ex) { - throw new InstantiationError(ex.getMessage()); - } + String className = (String) params.getParameter( + ClientPNames.CONNECTION_MANAGER_FACTORY_CLASS_NAME); + if (className != null) { + try { + Class clazz = Class.forName(className); + factory = (ClientConnectionManagerFactory) clazz.newInstance(); + } catch (ClassNotFoundException ex) { + throw new IllegalStateException("Invalid class name: " + className); + } catch (IllegalAccessException ex) { + throw new IllegalAccessError(ex.getMessage()); + } catch (InstantiationException ex) { + throw new InstantiationError(ex.getMessage()); } } - - if(factory != null) { + if (factory != null) { connManager = factory.newInstance(params, registry); } else { connManager = new SingleClientConnManager(getParams(), registry); diff --git a/httpclient/src/main/java/org/apache/http/impl/client/DefaultProxyAuthenticationHandler.java b/httpclient/src/main/java/org/apache/http/impl/client/DefaultProxyAuthenticationHandler.java index 36ba9ddbb..c8496b1f2 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/DefaultProxyAuthenticationHandler.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/DefaultProxyAuthenticationHandler.java @@ -40,9 +40,12 @@ import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.auth.AUTH; import org.apache.http.auth.MalformedChallengeException; +import org.apache.http.client.AuthenticationHandler; import org.apache.http.protocol.HttpContext; /** + * Default {@link AuthenticationHandler} implementation for proxy host + * authentication. * * @since 4.0 */ diff --git a/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java b/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java index b9268f328..e2d0e4cb9 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/DefaultRequestDirector.java @@ -124,9 +124,13 @@ import org.apache.http.protocol.HttpRequestExecutor; *
  • {@link org.apache.http.cookie.params.CookieSpecPNames#SINGLE_COOKIE_HEADER}
  • *
  • {@link org.apache.http.auth.params.AuthPNames#CREDENTIAL_CHARSET}
  • *
  • {@link org.apache.http.client.params.ClientPNames#COOKIE_POLICY}
  • - *
  • {@link org.apache.http.client.params.ClientPNames#VIRTUAL_HOST}
  • + *
  • {@link org.apache.http.client.params.ClientPNames#HANDLE_AUTHENTICATION}
  • + *
  • {@link org.apache.http.client.params.ClientPNames#HANDLE_REDIRECTS}
  • *
  • {@link org.apache.http.client.params.ClientPNames#MAX_REDIRECTS}
  • + *
  • {@link org.apache.http.client.params.ClientPNames#ALLOW_CIRCULAR_REDIRECTS}
  • + *
  • {@link org.apache.http.client.params.ClientPNames#VIRTUAL_HOST}
  • *
  • {@link org.apache.http.client.params.ClientPNames#DEFAULT_HOST}
  • + *
  • {@link org.apache.http.client.params.ClientPNames#DEFAULT_HEADERS}
  • * * * @since 4.0 diff --git a/httpclient/src/main/java/org/apache/http/impl/client/DefaultTargetAuthenticationHandler.java b/httpclient/src/main/java/org/apache/http/impl/client/DefaultTargetAuthenticationHandler.java index 94f105b2b..a6be9ace9 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/DefaultTargetAuthenticationHandler.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/DefaultTargetAuthenticationHandler.java @@ -40,10 +40,13 @@ import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.auth.AUTH; import org.apache.http.auth.MalformedChallengeException; +import org.apache.http.client.AuthenticationHandler; import org.apache.http.protocol.HttpContext; /** - * + * Default {@link AuthenticationHandler} implementation for target host + * authentication. + * * @since 4.0 */ @Immutable diff --git a/httpclient/src/main/java/org/apache/http/impl/client/RoutedRequest.java b/httpclient/src/main/java/org/apache/http/impl/client/RoutedRequest.java index 635a05460..3fc88d265 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/RoutedRequest.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/RoutedRequest.java @@ -72,4 +72,4 @@ public class RoutedRequest { return route; } -} // interface RoutedRequest +} diff --git a/httpclient/src/main/java/org/apache/http/impl/client/TunnelRefusedException.java b/httpclient/src/main/java/org/apache/http/impl/client/TunnelRefusedException.java index ce18581dc..32167a047 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/TunnelRefusedException.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/TunnelRefusedException.java @@ -37,7 +37,8 @@ import org.apache.http.HttpException; import org.apache.http.HttpResponse; /** - * + * Signals that the tunnel request was rejected by the proxy host. + * * @since 4.0 */ @Immutable diff --git a/httpclient/src/main/java/org/apache/http/impl/cookie/NetscapeDraftSpec.java b/httpclient/src/main/java/org/apache/http/impl/cookie/NetscapeDraftSpec.java index 1c63eaf49..28aebd719 100644 --- a/httpclient/src/main/java/org/apache/http/impl/cookie/NetscapeDraftSpec.java +++ b/httpclient/src/main/java/org/apache/http/impl/cookie/NetscapeDraftSpec.java @@ -42,6 +42,7 @@ import org.apache.http.HeaderElement; import org.apache.http.cookie.ClientCookie; import org.apache.http.cookie.Cookie; import org.apache.http.cookie.CookieOrigin; +import org.apache.http.cookie.CookieSpec; import org.apache.http.cookie.MalformedCookieException; import org.apache.http.cookie.SM; import org.apache.http.message.BufferedHeader;