commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpMethodBase.java
Date Mon, 12 May 2003 19:33:42 GMT
olegk       2003/05/12 12:33:42

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HttpMethodBase.java
  Log:
  Changelog:
  
  - Adds authentication realm & proxy authentication realm properties to the HttpMethodBase
class
  
  Contributed by Oleg Kalnichevski
  
  Revision  Changes    Path
  1.146     +35 -6     jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java
  
  Index: HttpMethodBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpMethodBase.java,v
  retrieving revision 1.145
  retrieving revision 1.146
  diff -u -r1.145 -r1.146
  --- HttpMethodBase.java	8 May 2003 17:33:51 -0000	1.145
  +++ HttpMethodBase.java	12 May 2003 19:33:42 -0000	1.146
  @@ -174,9 +174,15 @@
       /** Realms that we tried to authenticate to */
       private Set realms = null;
   
  +    /** Actual authentication realm */
  +    private String realm = null;
  +
       /** Proxy Realms that we tried to authenticate to */
       private Set proxyRealms = null;
   
  +    /** Actual proxy authentication realm */
  +    private String proxyRealm = null;
  +
       /** My request path. */
       private String path = null;
   
  @@ -195,7 +201,7 @@
       /** Whether or not I should automatically follow redirects. */
       private boolean followRedirects = false;
   
  -    /** Whether or not I should automatically processs authentication. */
  +    /** Whether or not I should automatically process authentication. */
       private boolean doAuthentication = true;
   
       /** Whether or not I should use the HTTP/1.1 protocol. */
  @@ -1263,6 +1269,8 @@
           path = null;
           followRedirects = false;
           doAuthentication = true;
  +        realm = null;
  +        proxyRealm = null;
           queryString = null;
           getRequestHeaderGroup().clear();
           getResponseHeaderGroup().clear();
  @@ -2420,11 +2428,13 @@
                           removeRequestHeader(HttpAuthenticator.WWW_AUTH_RESP);
                           authenticated = HttpAuthenticator.authenticate(
                               authscheme, this, conn, state);
  +                        this.realm = authscheme.getRealm();
                           break;
                       case HttpStatus.SC_PROXY_AUTHENTICATION_REQUIRED:
                           removeRequestHeader(HttpAuthenticator.PROXY_AUTH_RESP);
                           authenticated = HttpAuthenticator.authenticateProxy(
                               authscheme, this, conn, state);
  +                        this.proxyRealm = authscheme.getRealm();
                           break;
                   }
               } catch (AuthenticationException e) {
  @@ -2448,6 +2458,26 @@
       }
   
       /**
  +     * Returns proxy authentication realm, if it has been used during authentication process.

  +     * Otherwise returns <tt>null</tt>.
  +     * 
  +     * @return proxy authentication realm
  +     */
  +    public String getProxyAuthenticationRealm() {
  +        return this.proxyRealm;
  +    }
  +
  +    /**
  +     * Returns authentication realm, if it has been used during authentication process.

  +     * Otherwise returns <tt>null</tt>.
  +     * 
  +     * @return authentication realm
  +     */
  +    public String getAuthenticationRealm() {
  +        return this.realm;
  +    }
  +
  +    /**
        * Write a request and read the response. Both the write to the server will
        * be retried {@link #maxRetries} times if the operation fails with a
        * HttpRecoverableException. The write will only be attempted if the read
  @@ -2677,5 +2707,4 @@
           this.responseBody = null;
           this.responseStream = responseStream;
       }
  -
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message