commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpState.java
Date Wed, 10 Jul 2002 02:53:31 GMT
dion        2002/07/09 19:53:31

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HttpState.java
  Log:
  Proxy Authentication patch from Evert Hoff <evert.hoff@pixie.co.za>
  
  Revision  Changes    Path
  1.6       +45 -4     jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpState.java
  
  Index: HttpState.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpState.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- HttpState.java	5 Jan 2002 11:16:00 -0000	1.5
  +++ HttpState.java	10 Jul 2002 02:53:31 -0000	1.6
  @@ -92,6 +92,11 @@
       private HashMap credMap = new HashMap();
   
       /**
  +     * My proxy {@link Credentials Credentials}, by realm.
  +     */
  +    private HashMap proxyCred = new HashMap();
  +
  +    /**
        * My {@link Cookie Cookie}s.
        */
       private ArrayList cookies = new ArrayList();
  @@ -226,4 +231,40 @@
           return (Credentials)(credMap.get(realm));
       }
   
  +    /**
  +     * <p>
  +     * Set the {@link Credentials} for the proxy with the given
  +     * authentication realm.
  +     * </p>
  +     * <p>
  +     * When <i>realm</i> is <code>null</code>, I'll use the given
  +     * <i>credentials</i> when no other {@link Credentials} have
  +     * been supplied for the given challenging realm.
  +     * (I.e., use a <code>null</code> realm to set the "default"
  +     * credentials.) Realms rarely make much sense with proxies, so
  +     * <code>null</code> is normally a good choice here.
  +     * </p>
  +     * @param realm the authentication realm
  +     * @param credentials the authentication credentials for the given realm
  +     */
  +    public void setProxyCredentials(String realm, Credentials credentials) {
  +        proxyCred.put(realm, credentials);
  +    }
  +
  +    /**
  +     * <p>
  +     * Get the {@link Credentials} for the proxy with the given authentication
  +     * realm.
  +     * </p>
  +     * <p>
  +     * When <i>realm</i> is <code>null</code>, I'll return the
  +     * "default" credentials.
  +     * (See {@link #setCredentials setCredentials}.)
  +     * </p>
  +     * @param realm the authentication realm
  +     * @return
  +     */
  +    public Credentials getProxyCredentials(String realm) {
  +        return (Credentials) (proxyCred.get(realm));
  +    }
   }
  
  
  

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


Mime
View raw message