diff --git a/httpclient/src/main/java/org/apache/http/impl/execchain/HttpAuthenticator.java b/httpclient/src/main/java/org/apache/http/impl/auth/HttpAuthenticator.java similarity index 93% rename from httpclient/src/main/java/org/apache/http/impl/execchain/HttpAuthenticator.java rename to httpclient/src/main/java/org/apache/http/impl/auth/HttpAuthenticator.java index 5788819b6..d7db7cd38 100644 --- a/httpclient/src/main/java/org/apache/http/impl/execchain/HttpAuthenticator.java +++ b/httpclient/src/main/java/org/apache/http/impl/auth/HttpAuthenticator.java @@ -25,7 +25,7 @@ * */ -package org.apache.http.impl.execchain; +package org.apache.http.impl.auth; import java.io.IOException; import java.util.Locale; @@ -51,6 +51,9 @@ import org.apache.http.client.AuthenticationStrategy; import org.apache.http.protocol.HttpContext; import org.apache.http.util.Asserts; +/** + * @since 4.3 + */ public class HttpAuthenticator { private final Log log; @@ -90,23 +93,6 @@ public class HttpAuthenticator { } } - /** - * @deprecated (4.3) use {@link #handleAuthChallenge( - * HttpHost, HttpResponse, AuthenticationStrategy, AuthState, HttpContext)}. - */ - @Deprecated - public boolean authenticate ( - final HttpHost host, - final HttpResponse response, - final AuthenticationStrategy authStrategy, - final AuthState authState, - final HttpContext context) { - return handleAuthChallenge(host, response, authStrategy, authState, context); - } - - /** - * @since 4.3 - */ public boolean handleAuthChallenge( final HttpHost host, final HttpResponse response, @@ -182,9 +168,6 @@ public class HttpAuthenticator { } } - /** - * @since 4.3 - */ public void generateAuthResponse( final HttpRequest request, final AuthState authState, diff --git a/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java b/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java index 3d6f7c5d5..3dc2298da 100644 --- a/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java +++ b/httpclient/src/main/java/org/apache/http/impl/client/HttpAuthenticator.java @@ -28,13 +28,18 @@ package org.apache.http.impl.client; import org.apache.commons.logging.Log; +import org.apache.http.HttpHost; +import org.apache.http.HttpResponse; +import org.apache.http.auth.AuthState; +import org.apache.http.client.AuthenticationStrategy; +import org.apache.http.protocol.HttpContext; /** * @deprecated (4.3) reserved for internal use. * */ @Deprecated -public class HttpAuthenticator extends org.apache.http.impl.execchain.HttpAuthenticator { +public class HttpAuthenticator extends org.apache.http.impl.auth.HttpAuthenticator { public HttpAuthenticator(final Log log) { super(log); @@ -44,4 +49,13 @@ public class HttpAuthenticator extends org.apache.http.impl.execchain.HttpAuthen super(); } + public boolean authenticate ( + final HttpHost host, + final HttpResponse response, + final AuthenticationStrategy authStrategy, + final AuthState authState, + final HttpContext context) { + return handleAuthChallenge(host, response, authStrategy, authState, context); + } + } diff --git a/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java b/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java index 2a69df932..b83b3d594 100644 --- a/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java +++ b/httpclient/src/main/java/org/apache/http/impl/execchain/MainClientExec.java @@ -64,6 +64,7 @@ import org.apache.http.conn.routing.HttpRoute; import org.apache.http.conn.routing.HttpRouteDirector; import org.apache.http.conn.routing.RouteTracker; import org.apache.http.entity.BufferedHttpEntity; +import org.apache.http.impl.auth.HttpAuthenticator; import org.apache.http.impl.conn.ConnectionShutdownException; import org.apache.http.message.BasicHttpRequest; import org.apache.http.protocol.HttpProcessor; diff --git a/httpclient/src/test/java/org/apache/http/impl/execchain/TestHttpAuthenticator.java b/httpclient/src/test/java/org/apache/http/impl/auth/TestHttpAuthenticator.java similarity index 98% rename from httpclient/src/test/java/org/apache/http/impl/execchain/TestHttpAuthenticator.java rename to httpclient/src/test/java/org/apache/http/impl/auth/TestHttpAuthenticator.java index 267dafbf5..23c67ffc1 100644 --- a/httpclient/src/test/java/org/apache/http/impl/execchain/TestHttpAuthenticator.java +++ b/httpclient/src/test/java/org/apache/http/impl/auth/TestHttpAuthenticator.java @@ -24,7 +24,7 @@ * . * */ -package org.apache.http.impl.execchain; +package org.apache.http.impl.auth; import java.util.HashMap; import java.util.LinkedList; @@ -51,11 +51,6 @@ import org.apache.http.client.AuthenticationStrategy; import org.apache.http.client.protocol.HttpClientContext; import org.apache.http.config.Lookup; import org.apache.http.config.RegistryBuilder; -import org.apache.http.impl.auth.BasicScheme; -import org.apache.http.impl.auth.BasicSchemeFactory; -import org.apache.http.impl.auth.DigestScheme; -import org.apache.http.impl.auth.DigestSchemeFactory; -import org.apache.http.impl.auth.NTLMSchemeFactory; import org.apache.http.impl.client.BasicCredentialsProvider; import org.apache.http.impl.client.TargetAuthenticationStrategy; import org.apache.http.message.BasicHeader;