olegk       2003/09/16 14:30:35

  Modified:    httpclient/src/java/org/apache/commons/httpclient Tag:
                        HTTPCLIENT_2_0_BRANCH HttpClient.java
                        HttpState.java
  Log:
  HttpState & HttpClient javadocs cleanup
  
  Contributed by Oleg Kalnichevski
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.76.2.1  +127 -84   
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java
  
  Index: HttpClient.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/HttpClient.java,v
  retrieving revision 1.76
  retrieving revision 1.76.2.1
  diff -u -r1.76 -r1.76.2.1
  --- HttpClient.java   12 May 2003 02:42:42 -0000      1.76
  +++ HttpClient.java   16 Sep 2003 21:30:35 -0000      1.76.2.1
  @@ -75,9 +75,9 @@
   
   /**
    * <p>
  - * An HTTP "user-agent", containing an [EMAIL PROTECTED] HttpState} and
  - * one or more [EMAIL PROTECTED] HttpConnection}s, to which
  - * [EMAIL PROTECTED] HttpMethod}s can be applied.
  + * An HTTP "user-agent", containing an [EMAIL PROTECTED] HttpState HTTP state} and
  + * one or more [EMAIL PROTECTED] HttpConnection HTTP connections}, to which
  + * [EMAIL PROTECTED] HttpMethod HTTP methods} can be applied.
    * </p>
    * @author <a href="mailto:[EMAIL PROTECTED]">Remy Maucherat</a>
    * @author <a href="mailto:[EMAIL PROTECTED]">Rodney Waldhoff</a>
  @@ -88,6 +88,7 @@
    * @author <a href="mailto:[EMAIL PROTECTED]">Mike Bowler</a>
    * @author Sam Maloney
    * @author Laura Werner
  + * @author <a href="mailto:[EMAIL PROTECTED]">Oleg Kalnichevski</a>
    * 
    * @version $Revision$ $Date$
    */
  @@ -120,7 +121,8 @@
       // ----------------------------------------------------------- Constructors
   
       /**
  -     * Creates an HttpClient using <code>SimpleHttpConnectionManager</code>.
  +     * Creates an instance of HttpClient using a
  +     * [EMAIL PROTECTED] SimpleHttpConnectionManager simple HTTP connection 
manager}.
        * 
        * @see SimpleHttpConnectionManager
        */
  @@ -129,8 +131,9 @@
       }
   
       /**
  -     * Creates an HttpClient with a user specified connection manager.
  -     * @param httpConnectionManager The connection manager to use.
  +     * Creates an instance of HttpClient with a user specified connection manager.
  +     * @param httpConnectionManager The [EMAIL PROTECTED] HttpConnectionManager 
connection manager}
  +     * to use.
        * 
        * @since 2.0
        */
  @@ -149,33 +152,48 @@
       
       // ----------------------------------------------------- Instance Variables
   
  -    /** The current connection manager */
  +    /** 
  +     * The [EMAIL PROTECTED] HttpConnectionManager connection manager} being used 
to manage
  +     * connections for this HttpClient
  +     */
       private HttpConnectionManager httpConnectionManager;
   
       /**
  -     * My [EMAIL PROTECTED] HttpState state}.
  +     * The [EMAIL PROTECTED] HttpState HTTP state} associated with this HttpClient.
        */
       private HttpState state;
   
  -    /** the timout when waiting for a connection from the connectionManager */
  +    /** 
  +     * The timout in milliseconds when waiting for a connection from the 
  +     * [EMAIL PROTECTED] HttpConnectionManager connection manager} 
  +     */
       private long httpConnectionTimeout = 0;
   
  -    /** The timeout in milliseconds*/
  +    /** 
  +     * The socket timeout in milliseconds.
  +     */
       private int timeoutInMilliseconds = 0;
   
  -    /** The connection timeout. */
  +    /** 
  +     * The connection timeout in milliseconds. 
  +     */
       private int connectionTimeout = 0;
   
  -    /** The host configuration to use */
  +    /** 
  +     * The [EMAIL PROTECTED] HostConfiguration host configuration} associated with
  +     * the HttpClient
  +     */
       private HostConfiguration hostConfiguration;
       
  -    /** True if strict mode is enabled. */
  +    /** 
  +     * True if strict mode is enabled. 
  +     */
       private boolean strictMode = false;
   
       // ------------------------------------------------------------- Properties
   
       /**
  -     * Get my [EMAIL PROTECTED] HttpState state}.
  +     * Returns [EMAIL PROTECTED] HttpState HTTP state} associated with the 
HttpClient.
        *
        * @see #setState(HttpState)
        * @return the shared client state
  @@ -185,52 +203,58 @@
       }
   
       /**
  -     * Set my [EMAIL PROTECTED] HttpState state}.
  +     * Assigns [EMAIL PROTECTED] HttpState HTTP state} for the HttpClient.
        *
        * @see #getState()
  -     * @param state the new state for the client
  +     * @param state the new [EMAIL PROTECTED] HttpState HTTP state} for the client
        */
       public synchronized void setState(HttpState state) {
           this.state = state;
       }
   
       /**
  -     *
  -     * @param strictMode <code>true</code> if strict mode should be used
  -     *
  +     * Defines how strictly the method follows the HTTP protocol specification  
  +     * (see RFC 2616 and other relevant RFCs). 
  +     * 
  +     * In the strict mode the method precisely
  +     * implements the requirements of the specification, whereas in non-strict mode 
  +     * it attempts to mimic the exact behaviour of commonly used HTTP agents, 
  +     * which many HTTP servers expect.
  +     * 
  +     * @param strictMode <tt>true</tt> for strict mode, <tt>false</tt> otherwise
  +     * 
        * @see #isStrictMode()
  -     *
        */
       public synchronized void setStrictMode(boolean strictMode) {
           this.strictMode = strictMode;
       }
   
       /**
  +     * Returns the value of the strict mode flag.
        *
  -     * @return <code>true</code> if strict mode being used
  -     *
  +     * @return <tt>true</tt> if strict mode is enabled, <tt>false</tt> otherwise
  +     * 
        * @see #setStrictMode(boolean)
  -     *
        */
       public synchronized boolean isStrictMode() {
           return strictMode;
       }
   
       /**
  -     * Sets the SO_TIMEOUT which is the timeout for waiting for data.
  -     *
  -     * A timeout value of zero is interpreted as an infinite timeout.
  +     * Sets the socket timeout (<tt>SO_TIMEOUT</tt>) in milliseconds which is the 
  +     * timeout for waiting for data. A timeout value of zero is interpreted as an 
  +     * infinite timeout.
        *
        * @param newTimeoutInMilliseconds Timeout in milliseconds
  -     *
        */
       public synchronized void setTimeout(int newTimeoutInMilliseconds) {
           this.timeoutInMilliseconds = newTimeoutInMilliseconds;
       }
   
       /**
  -     * Sets the timeout used when retrieving an HttpConnection from the
  -     * HttpConnectionManager.
  +     * Sets the timeout in milliseconds used when retrieving an 
  +     * [EMAIL PROTECTED] HttpConnection HTTP connection} from the
  +     * [EMAIL PROTECTED] HttpConnectionManager HTTP connection manager}.
        * 
        * @param timeout the timeout in milliseconds
        * 
  @@ -241,10 +265,12 @@
       }
   
       /**
  -     * Sets the timeout until a connection is etablished. A value of 0 means
  -     * the timeout is not used. The default value is 0.
  -     * @see HttpConnection#setConnectionTimeout(int)
  +     * Sets the timeout until a connection is etablished. A timeout value of 
  +     * zero means the timeout is not used. The default value is zero.
  +     * 
        * @param newTimeoutInMilliseconds Timeout in milliseconds.
  +     * 
  +     * @see HttpConnection#setConnectionTimeout(int)
        */
       public synchronized void setConnectionTimeout(int newTimeoutInMilliseconds) {
          this.connectionTimeout = newTimeoutInMilliseconds;
  @@ -253,15 +279,15 @@
       // --------------------------------------------------------- Public Methods
   
       /**
  -     * @deprecated use hostConfiguration
  -     * 
  -     * Sets the host, port and protocol(http) to be used when executing a
  +     * Sets the host, port and default protocol (http) to be used when executing a
        * method.
        * 
        * @param host the host to connect to
        * @param port the port to connect to
        *
        * @see #getHostConfiguration()
  +     * 
  +     * @deprecated use [EMAIL PROTECTED] HostConfiguration}
        */
       public void startSession(String host, int port) {
           LOG.trace("enter HttpClient.startSession(String, int)");
  @@ -269,8 +295,6 @@
       }
   
       /**
  -     * @deprecated use hostConfiguration
  -     * 
        * Sets the host, port and protocol to be used when executing a method.
        * 
        * @param host the host to connect to
  @@ -278,6 +302,8 @@
        * @param https when <code>true</code>, create an HTTPS session
        *
        * @see #getHostConfiguration()
  +     * 
  +     * @deprecated use [EMAIL PROTECTED] HostConfiguration}
        */    
       public void startSession(String host, int port, boolean https) {
           LOG.trace("enter HttpClient.startSession(String, int, boolean)");
  @@ -291,9 +317,7 @@
       }
   
       /**
  -     * @deprecated use hostConfiguration and httpState
  -     * 
  -     * Sets the host, port, protocol(http) and credentials to be used when
  +     * Sets the host, port, default protocol (http) and credentials to be used when
        * executing a method.
        *
        * @param host the host to connect to
  @@ -303,6 +327,8 @@
        * @see #getHostConfiguration()
        * @see #getState()
        * @see #startSession(String, int, Credentials, boolean)
  +     * 
  +     * @deprecated use [EMAIL PROTECTED] HostConfiguration} and [EMAIL PROTECTED] 
HttpState} 
        */
       public void startSession(String host, int port, Credentials creds) {
           LOG.trace("enter HttpClient.startSession(String, int, Credentials)");
  @@ -310,8 +336,6 @@
       }
   
       /**
  -     * @deprecated use hostConfiguration and httpState
  -     *
        * Sets the host, port, protocol and credentials to be used when executing a
        * method.
        *
  @@ -322,6 +346,8 @@
        *
        * @see #getHostConfiguration()
        * @see #getState()
  +     * 
  +     * @deprecated use [EMAIL PROTECTED] HostConfiguration} and [EMAIL PROTECTED] 
HttpState} 
        */
       public void startSession(String host, int port, Credentials creds, boolean 
https) {
           LOG.trace("enter HttpClient.startSession(String, int, Credentials, 
boolean)");
  @@ -342,8 +368,6 @@
       }
   
       /**
  -     * @deprecated use hostConfiguration and httpState
  -     *
        * Sets the host, port, protocol and credentials to be used when executing a
        * method using the server specified by the scheme, userinfo, host and port
        * of the given <i>uri</i>.
  @@ -358,7 +382,8 @@
        * @throws URIException If the URI is bad.
        * 
        * @see #getHostConfiguration()
  -     * @see #getState()
  +     * 
  +     * @deprecated use [EMAIL PROTECTED] HostConfiguration} 
        */
       public void startSession(URI uri) 
           throws URIException, IllegalStateException {
  @@ -393,8 +418,6 @@
       }
   
       /**
  -     * @deprecated use hostConfiguration
  -     *
        * Sets the host, port and protocol to be used when executing a method.
        * <p>
        * Note that everything but the protocol, host and port of the
  @@ -406,6 +429,8 @@
        * @exception IllegalArgumentException if the protocol is not http or https
        *
        * @see #getHostConfiguration()
  +     * 
  +     * @deprecated use [EMAIL PROTECTED] HostConfiguration} 
        */
       public void startSession(URL url) throws IllegalArgumentException {
           LOG.trace("enter HttpClient.startSession(String, int, Credentials, 
boolean)");
  @@ -417,8 +442,6 @@
       }
   
       /**
  -     * @deprecated use hostConfiguration and httpState
  -     *
        * Sets the host, port, protocol and credentials to be used when executing a
        * method.
        * <p>
  @@ -433,6 +456,8 @@
        *
        * @see #getHostConfiguration()   
        * @see #getState()
  +     * 
  +     * @deprecated use [EMAIL PROTECTED] HostConfiguration} and [EMAIL PROTECTED] 
HttpState} 
        */
       public void startSession(URL url, Credentials creds) 
           throws IllegalArgumentException {
  @@ -443,8 +468,6 @@
       }
   
       /**
  -     * @deprecated use hostConfiguration
  -     * 
        * Sets the host, port, protocol(http) and proxy to be used when executing a
        * method.
        * 
  @@ -454,6 +477,8 @@
        * @param proxyport the proxy port to connect via
        *
        * @see #getHostConfiguration()
  +     * 
  +     * @deprecated use [EMAIL PROTECTED] HostConfiguration} 
        */
       public void startSession(String host, int port, String proxyhost, int 
proxyport) {
           LOG.trace("enter HttpClient.startSession(String, int, String, int)");
  @@ -461,8 +486,6 @@
       }
   
       /**
  -     * @deprecated use hostConfiguration
  -     * 
        * Sets the host, port, protocol and proxy to be used when executing a
        * method.
        * 
  @@ -473,6 +496,8 @@
        * @param secure whether or not to connect using HTTPS
        * 
        * @see #getHostConfiguration()
  +     * 
  +     * @deprecated use [EMAIL PROTECTED] HostConfiguration} 
        */
       public void startSession(String host, int port, 
           String proxyhost, int proxyport, boolean secure) {
  @@ -484,13 +509,15 @@
       }
   
       /**
  -     * Executes the given method.
  +     * Executes the given [EMAIL PROTECTED] HttpMethod HTTP method}.
        *
  -     * @param method the [EMAIL PROTECTED] HttpMethod} to execute.
  +     * @param method the [EMAIL PROTECTED] HttpMethod HTTP method} to execute.
        * @return the method's response code
        *
  -     * @throws IOException if an I/O error occurs
  -     * @throws HttpException if a protocol exception occurs
  +     * @throws IOException If an I/O (transport) error occurs. Some transport 
exceptions
  +     *                     can be recovered from.
  +     * @throws HttpException  If a protocol exception occurs. Usually protocol 
exceptions 
  +     *                    cannot be recovered from.
        */
       public int executeMethod(HttpMethod method)
           throws IOException, HttpException  {
  @@ -508,14 +535,17 @@
       }
   
       /**
  -    * Executes the given method.
  +    * Executes the given [EMAIL PROTECTED] HttpMethod HTTP method} using custom 
  +    * [EMAIL PROTECTED] HostConfiguration host configuration}.
       *
  -    * @param hostConfiguration The configuration to use.
  -    * @param method the [EMAIL PROTECTED] HttpMethod} to execute.
  +    * @param hostConfiguration The [EMAIL PROTECTED] HostConfiguration host 
configuration} to use.
  +    * @param method the [EMAIL PROTECTED] HttpMethod HTTP method} to execute.
       * @return the method's response code
       *
  -    * @throws IOException if an I/O error occurs
  -    * @throws HttpException if a protocol exception occurs
  +    * @throws IOException If an I/O (transport) error occurs. Some transport 
exceptions
  +    *                     can be recovered from.
  +    * @throws HttpException  If a protocol exception occurs. Usually protocol 
exceptions 
  +    *                    cannot be recovered from.
       * @since 2.0
       */
       public int executeMethod(HostConfiguration hostConfiguration, HttpMethod method)
  @@ -529,17 +559,21 @@
   
       
       /**
  -     * Executes the given method.
  -     *
  -     * @param hostConfiguration The configuration to use.
  -     * @param method the [EMAIL PROTECTED] HttpMethod} to execute.
  -     * @param state the [EMAIL PROTECTED] HttpState} to use when executing the 
method.
  +     * Executes the given [EMAIL PROTECTED] HttpMethod HTTP method} using the given 
custom 
  +     * [EMAIL PROTECTED] HostConfiguration host configuration} with the given 
custom 
  +     * [EMAIL PROTECTED] HttpState HTTP state}.
  +     *
  +     * @param hostConfiguration The [EMAIL PROTECTED] HostConfiguration host 
configuration} to use.
  +     * @param method the [EMAIL PROTECTED] HttpMethod HTTP method} to execute.
  +     * @param state the [EMAIL PROTECTED] HttpState HTTP state} to use when 
executing the method.
        * If <code>null</code>, the state returned by [EMAIL PROTECTED] #getState} 
will be used instead.
        *
        * @return the method's response code
        *
  -     * @throws IOException if an I/O error occurs
  -     * @throws HttpException if a protocol exception occurs
  +     * @throws IOException If an I/O (transport) error occurs. Some transport 
exceptions
  +     *                     can be recovered from.
  +     * @throws HttpException  If a protocol exception occurs. Usually protocol 
exceptions 
  +     *                    cannot be recovered from.
        * @since 2.0
        */
       public int executeMethod(HostConfiguration hostConfiguration, 
  @@ -639,7 +673,7 @@
       }
   
       /**
  -     * @deprecated this method has no effect. HttpMethod.releaseConnection()
  +     * @deprecated this method has no effect. [EMAIL PROTECTED] 
HttpMethod#releaseConnection()}
        * should be used to release resources after a HttpMethod has been executed.
        * 
        * @see HttpMethod#releaseConnection()
  @@ -648,7 +682,7 @@
       }
   
       /**
  -      * Return the host that the client is accessing.
  +      * Returns the host that the client is accessing.
         *
         * @return The host that the client is accessing, or <code>null</code> if
         * the session has not been started via startSession.
  @@ -658,7 +692,7 @@
        }
   
        /**
  -      * Return the port that the client is accessing.
  +      * Returns the port that the client is accessing.
         *
         * @return The port that the client is accessing, or -1 if the session
         * has not been started via startSession().
  @@ -668,8 +702,10 @@
        }
        
       /**
  -     * Returns the hostConfiguration.
  -     * @return HostConfiguration
  +     * Returns the [EMAIL PROTECTED] HostConfiguration host configuration} 
associated with the 
  +     * HttpClient.
  +     * 
  +     * @return [EMAIL PROTECTED] HostConfiguration host configuration}
        * 
        * @since 2.0
        */
  @@ -678,8 +714,10 @@
       }
   
       /**
  -     * Sets the hostConfiguration.
  -     * @param hostConfiguration The hostConfiguration to set
  +     * Assigns the [EMAIL PROTECTED] HostConfiguration host configuration} to use 
with the
  +     * HttpClient.
  +     * 
  +     * @param hostConfiguration The [EMAIL PROTECTED] HostConfiguration host 
configuration} to set
        * 
        * @since 2.0
        */
  @@ -688,8 +726,10 @@
       }
   
       /**
  -     * Returns the httpConnectionManager.
  -     * @return HttpConnectionManager
  +     * Returns the [EMAIL PROTECTED] HttpConnectionManager HTTP connection manager} 
associated 
  +     * with the HttpClient.
  +     * 
  +     * @return [EMAIL PROTECTED] HttpConnectionManager HTTP connection manager}
        * 
        * @since 2.0
        */
  @@ -698,8 +738,11 @@
       }
   
       /**
  -     * Sets the httpConnectionManager.
  -     * @param httpConnectionManager The httpConnectionManager to set
  +     * Assigns the [EMAIL PROTECTED] HttpConnectionManager HTTP connection manager} 
to use with
  +     * the HttpClient.
  +     * 
  +     * @param httpConnectionManager The [EMAIL PROTECTED] HttpConnectionManager 
HTTP connection manager}
  +     *  to set
        * 
        * @since 2.0
        */
  
  
  
  1.22.2.1  +113 -115  
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.22
  retrieving revision 1.22.2.1
  diff -u -r1.22 -r1.22.2.1
  --- HttpState.java    8 May 2003 18:39:07 -0000       1.22
  +++ HttpState.java    16 Sep 2003 21:30:35 -0000      1.22.2.1
  @@ -78,8 +78,8 @@
   /**
    * <p>
    * A container for HTTP attributes that may persist from request
  - * to request, such as [EMAIL PROTECTED] Cookie}s and authentication
  - * [EMAIL PROTECTED] Credentials}.
  + * to request, such as [EMAIL PROTECTED] Cookie cookies} and authentication
  + * [EMAIL PROTECTED] Credentials credentials}.
    * </p>
    * <p>
    * Preemptive authentication can be turned on by using the property value of
  @@ -104,7 +104,7 @@
       // ----------------------------------------------------- Instance Variables
   
       /**
  -     * Whether I should attempt to authenticate preemptively.
  +     * Whether authentication should be attempted preemptively.
        */
       private boolean preemptive;
   
  @@ -120,12 +120,14 @@
       public static final String PREEMPTIVE_DEFAULT = "false";
   
       /**
  -     * My [EMAIL PROTECTED] Credentials Credentials}s, by realm.
  +     * Map of [EMAIL PROTECTED] Credentials credentials} by realm that this 
  +     * HTTP state contains.
        */
       private HashMap credMap = new HashMap();
   
       /**
  -     * My proxy [EMAIL PROTECTED] Credentials Credentials}, by realm.
  +     * Map of [EMAIL PROTECTED] Credentials proxy credentials} by realm that this
  +     * HTTP state contains
        */
       private HashMap proxyCred = new HashMap();
   
  @@ -135,11 +137,12 @@
       public static final HttpAuthRealm DEFAULT_AUTH_REALM = new HttpAuthRealm(null, 
null); 
   
       /**
  -     * My [EMAIL PROTECTED] Cookie Cookie}s.
  +     * Array of [EMAIL PROTECTED] Cookie cookies} that this HTTP state contains.
        */
       private ArrayList cookies = new ArrayList();
       /**
  -     * My cookie policy.  Default is [EMAIL PROTECTED] CookiePolicy.RFC2109}
  +     * Cookie policy that applies to this HTTP state. Default is 
  +     * [EMAIL PROTECTED] CookiePolicy#RFC2109}
        */
       private int cookiePolicy = CookiePolicy.RFC2109;
   
  @@ -152,7 +155,7 @@
       private static final Log LOG = LogFactory.getLog(HttpState.class);
   
       /**
  -     * Constructor for HttpState.
  +     * Default constructor.
        */
       public HttpState() {
           
  @@ -180,11 +183,11 @@
       // ------------------------------------------------------------- Properties
   
       /**
  -     * Add a cookie.
  -     * If the given <i>cookie</i> has already expired,
  -     * deletes the corresponding existing cookie (if any).
  +     * Adds an [EMAIL PROTECTED] Cookie HTTP cookie}, replacing any existing 
equivalent cookies.
  +     * If the given cookie has already expired it will not be added, but existing 
  +     * values will still be removed.
        * 
  -     * @param cookie the [EMAIL PROTECTED] Cookie} to add
  +     * @param cookie the [EMAIL PROTECTED] Cookie cookie} to be added
        * 
        * @see #addCookies(Cookie[])
        * 
  @@ -208,30 +211,30 @@
       }
   
       /**
  -     * Add zero or more cookies
  -     * If any given <i>cookie</i> has already expired,
  -     * deletes the corresponding existing cookie (if any).
  +     * Adds an array of [EMAIL PROTECTED] Cookie HTTP cookies}. Cookies are added 
individually and 
  +     * in the given array order. If any of the given cookies has already expired it 
will 
  +     * not be added, but existing values will still be removed.
        * 
  -     * @param newcookies the [EMAIL PROTECTED] Cookie}s to add
  +     * @param cookies the [EMAIL PROTECTED] Cookie cookies} to be added
        * 
        * @see #addCookie(Cookie)
        * 
  -     * 
        */
  -    public synchronized void addCookies(Cookie[] newcookies) {
  +    public synchronized void addCookies(Cookie[] cookies) {
           LOG.trace("enter HttpState.addCookies(Cookie[])");
   
  -        if (newcookies != null) {
  -            for (int i = 0; i < newcookies.length; i++) {
  -                this.addCookie(newcookies[i]);
  +        if (cookies != null) {
  +            for (int i = 0; i < cookies.length; i++) {
  +                this.addCookie(cookies[i]);
               }
           }
       }
   
       /**
  -     * Obtain an array of my [EMAIL PROTECTED] Cookie}s.
  +     * Returns an array of [EMAIL PROTECTED] Cookie cookies} that this HTTP
  +     * state currently contains.
        * 
  -     * @return an array of my [EMAIL PROTECTED] Cookie}s.
  +     * @return an array of [EMAIL PROTECTED] Cookie cookies}.
        * 
        * @see #getCookies(String, int, String, boolean, java.util.Date)
        * 
  @@ -242,20 +245,20 @@
       }
   
       /**
  -     * Obtain an array of my [EMAIL PROTECTED] Cookie}s that
  -     * match the given request parameters.
  +     * Returns an array of [EMAIL PROTECTED] Cookie cookies} in this HTTP 
  +     * state that match the given request parameters.
        * 
        * @param domain the request domain
        * @param port the request port
        * @param path the request path
        * @param secure <code>true</code> when using HTTPS
  -     * @param now the [EMAIL PROTECTED] Date} by which expiration is determined
  -     * @return an array of my [EMAIL PROTECTED] Cookie}s.
  +     * @param now the [EMAIL PROTECTED] Date date} by which expiration is determined
  +     * 
  +     * @return an array of [EMAIL PROTECTED] Cookie cookies}.
        * 
  -     * @see Cookie#matches
        * @see #getCookies()
        * 
  -     * @deprecated use HttpState.getCookies(String, int, String, boolean)
  +     * @deprecated use CookieSpec#match(String, int, String, boolean, Cookie)
        */
       public synchronized Cookie[] getCookies(
           String domain, 
  @@ -269,18 +272,19 @@
   
   
       /**
  -     * Obtain an array of my [EMAIL PROTECTED] Cookie}s that
  -     * match the given request parameters.
  +     * Returns an array of [EMAIL PROTECTED] Cookie cookies} in this HTTP
  +     * state that match the given request parameters.
        * 
        * @param domain the request domain
        * @param port the request port
        * @param path the request path
        * @param secure <code>true</code> when using HTTPS
  -     * @return an array of my [EMAIL PROTECTED] Cookie}s.
        * 
  -     * @see Cookie#matches
  +     * @return an array of [EMAIL PROTECTED] Cookie cookies}.
  +     * 
        * @see #getCookies()
        * 
  +     * @deprecated use [EMAIL PROTECTED] CookieSpec#match(String, int, String, 
boolean, Cookie)}
        */
       public synchronized Cookie[] getCookies(
           String domain, 
  @@ -302,9 +306,8 @@
       }
   
       /**
  -     * Remove all of my [EMAIL PROTECTED] Cookie}s that
  -     * have expired according to the current
  -     * system time.
  +     * Removes all of [EMAIL PROTECTED] Cookie cookies} in this HTTP state
  +     * that have expired according to the current system time.
        * 
        * @see #purgeExpiredCookies(java.util.Date)
        * 
  @@ -315,12 +318,15 @@
       }
   
       /**
  -     * Remove all of my [EMAIL PROTECTED] Cookie}s that have expired by the 
specified
  -     * <i>date</i>.
  +     * Removes all of [EMAIL PROTECTED] Cookie cookies} in this HTTP state
  +     * that have expired by the specified [EMAIL PROTECTED] java.util.Date date}. 
  +     * 
  +     * @param date The [EMAIL PROTECTED] java.util.Date date} to compare against.
        * 
  -     * @param date The date to compare against.
        * @return true if any cookies were purged.
  +     * 
        * @see Cookie#isExpired(java.util.Date)
  +     * 
        * @see #purgeExpiredCookies()
        */
       public synchronized boolean purgeExpiredCookies(Date date) {
  @@ -338,8 +344,10 @@
   
   
       /**
  -     * Return the current [EMAIL PROTECTED] CookiePolicy}
  -     * @return The cookie policy.
  +     * Returns the current [EMAIL PROTECTED] CookiePolicy cookie policy} for this
  +     * HTTP state.
  +     * 
  +     * @return The [EMAIL PROTECTED] CookiePolicy cookie policy}.
        */
       
       public int getCookiePolicy() {
  @@ -349,9 +357,10 @@
   
       /**
        * Defines whether preemptive authentication should be 
  -     * attempted or not.
  +     * attempted.
        * 
  -     * @param value boolean flag
  +     * @param value <tt>true</tt> if preemptive authentication should be 
  +     * attempted, <tt>false</tt> otherwise. 
        */
       
       public void setAuthenticationPreemptive(boolean value) {
  @@ -360,8 +369,8 @@
   
   
       /**
  -     * Return <tt>true</tt> if preemptive authentication should be 
  -     * attempted, otherwise return <tt>false</tt>
  +     * Returns <tt>true</tt> if preemptive authentication should be 
  +     * attempted, <tt>false</tt> otherwise.
        * 
        * @return boolean flag.
        */
  @@ -372,10 +381,13 @@
       
   
       /**
  -     * Set the [EMAIL PROTECTED] CookiePolicy} to one of [EMAIL PROTECTED]
  -     * CookiePolicy#COMPATIBILITY}, [EMAIL PROTECTED] CookiePolicy#NETSCAPE_DRAFT} 
or
  -     * [EMAIL PROTECTED] CookiePolicy#RFC2109}
  -     * @param policy new cookie policy
  +     * Sets the current [EMAIL PROTECTED] CookiePolicy cookie policy} for this HTTP
  +     * state to one of the following supported policies: 
  +     * [EMAIL PROTECTED] CookiePolicy#COMPATIBILITY}, 
  +     * [EMAIL PROTECTED] CookiePolicy#NETSCAPE_DRAFT} or
  +     * [EMAIL PROTECTED] CookiePolicy#RFC2109}.
  +     * 
  +     * @param policy new [EMAIL PROTECTED] CookiePolicy cookie policy}
        */
       
       public void setCookiePolicy(int policy) {
  @@ -383,26 +395,21 @@
       }
   
       /**
  -     * Set the Credentials for the given authentication realm.
  -     *
  -     * When <i>realm</i> is <code>null</code>, I'll use the given
  -     * <i>credentials</i> when no other [EMAIL PROTECTED] Credentials} have
  -     * been supplied for the given challenging realm.
  -     * (I.e., use a <code>null</code> realm to set the "default"
  -     * credentials.)
  -     * <p>
  -     * Any previous credentials for this realm will be overwritten.
  +     * Sets the [EMAIL PROTECTED] Credentials credentials} for the given 
authentication 
  +     * realm. The <code>null</code> realm signifies default credentials, which 
  +     * should be used when no [EMAIL PROTECTED] Credentials credentials} have been 
explictly 
  +     * supplied for the given challenging realm. Any previous credentials for
  +     * the given realm will be overwritten.
        *
        * @deprecated This method does not distinguish between realms with the
  -     * same name on different hosts.  Use
  -     * [EMAIL PROTECTED] HttpState#setCredentials(String, Credentials)} instead.
  +     * same name on different hosts.  
  +     * Use [EMAIL PROTECTED] #setCredentials(String, String, Credentials)} instead.
        * 
        * @param realm the authentication realm
        * @param credentials the authentication credentials for the given realm
        * 
        * @see #getCredentials(String, String)
        * @see #setProxyCredentials(String, String, Credentials)
  -     * 
        */
       
       public synchronized void setCredentials(String realm, Credentials credentials) {
  @@ -410,20 +417,20 @@
           setCredentials(realm, null, credentials);
       }
       
  -    /** Sets the credentials for <tt>realm</tt> on <tt>host</tt>.
  -     * with no host.
  -     * 
  -     * When <i>realm</i> is <code>null</code>, I'll use the given
  -     * <i>credentials</i> when no other [EMAIL PROTECTED] Credentials} have
  -     * been supplied for the given challenging realm.
  -     * (I.e., use a <code>null</code> realm to set the "default"
  -     * credentials.)
  -     * <p>
  -     * Any previous credentials for this realm will be overwritten.
  +    /** 
  +     * Sets the [EMAIL PROTECTED] Credentials credentials} for the given 
authentication 
  +     * realm on the given host. The <code>null</code> realm signifies default 
  +     * credentials for the given host, which should be used when no 
  +     * [EMAIL PROTECTED] Credentials credentials} have been explictly supplied for 
the 
  +     * challenging realm. The <code>null</code> host signifies default 
  +     * credentials, which should be used when no [EMAIL PROTECTED] Credentials 
credentials} 
  +     * have been explictly supplied for the challenging host. Any previous 
  +     * credentials for the given realm on the given host will be overwritten.
        * 
        * @param realm the authentication realm
        * @param host the host the realm belongs to
  -     * @param credentials the authentication credentials for the given realm.
  +     * @param credentials the authentication [EMAIL PROTECTED] Credentials 
credentials} 
  +     * for the given realm.
        * 
        * @see #getCredentials(String, String)
        * @see #setProxyCredentials(String, String, Credentials) 
  @@ -437,7 +444,7 @@
   
   
       /**
  -     * Find matching credentials for the given authentication realm and host.
  +     * Find matching [EMAIL PROTECTED] Credentials credentials} for the given 
authentication realm and host.
        *
        * If the <i>realm</i> exists on <i>host</i>, return the coresponding 
credentials.
        * If the <i>host</i> exists with a <tt>null</tt> <i>realm</i>, return the 
corresponding
  @@ -471,7 +478,8 @@
       }
       
       /**
  -     * Get the Credentials for the given authentication realm.
  +     * Get the [EMAIL PROTECTED] Credentials credentials} for the given 
authentication realm on the 
  +     * given host.
        *
        * If the <i>realm</i> exists on <i>host</i>, return the coresponding 
credentials.
        * If the <i>host</i> exists with a <tt>null</tt> <i>realm</i>, return the 
corresponding
  @@ -486,7 +494,6 @@
        * @return the credentials 
        * 
        * @see #setCredentials(String, String, Credentials)
  -     * 
        */
       
       public synchronized Credentials getCredentials(String realm, String host) {
  @@ -495,13 +502,7 @@
       }
   
       /**
  -     * Get the Credentials for the given authentication realm.
  -     *
  -     * If the <i>realm</i> exists on <i>host</i>, return the coresponding 
credentials.
  -     * If the <i>realm</i> exists with a <tt>null</tt> <i>host</i>, return the
  -     * corresponding credentials.  If the <i>realm</i> does not exist, return
  -     * the default Credentials.  If there is no default credentials, return
  -     * <code>null</code>.
  +     * Get the [EMAIL PROTECTED] Credentials credentials} for the given 
authentication realm.
        *
        * @deprecated This method does not distinguish between realms on different
        * servers with the same name.  Use [EMAIL PROTECTED] #getCredentials(String, 
String)}
  @@ -521,17 +522,12 @@
       }
   
       /**
  -     * Set the for the proxy with the given authentication realm.
  -     *
  -     * When <i>realm</i> is <code>null</code>, I'll use the given
  -     * <i>credentials</i> when no other [EMAIL PROTECTED] 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>
  -     * Any previous credentials for this realm will be overwritten.
  -     *
  +     * Sets the [EMAIL PROTECTED] Credentials credentials} for the given proxy 
authentication 
  +     * realm. The <code>null</code> realm signifies default credentials, which 
  +     * should be used when no [EMAIL PROTECTED] Credentials credentials} have been 
explictly 
  +     * supplied for the given challenging proxy realm. Any previous credentials for
  +     * the given realm will be overwritten.
  +     * 
        * @deprecated This method does not differentiate between realms with
        * the same name on different servers.  Use
        * [EMAIL PROTECTED] #setProxyCredentials(String, String, Credentials)} instead.
  @@ -550,17 +546,16 @@
       }
       
       /**
  -     * Set the credentials for the proxy with the given authentication realm.
  -     *
  -     * When <i>realm</i> and <i>proxyHost</i> are <code>null</code>, I'll use the 
given
  -     * <i>credentials</i> when no other [EMAIL PROTECTED] 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>
  -     * Any previous credentials for this realm will be overwritten.
  -     *
  +     * Sets the [EMAIL PROTECTED] Credentials credentials} for the given proxy 
authentication 
  +     * realm on the given proxy host. The <code>null</code> proxy realm signifies 
  +     * default credentials for the given proxy host, which should be used when no 
  +     * [EMAIL PROTECTED] Credentials credentials} have been explictly supplied for 
the 
  +     * challenging proxy realm. The <code>null</code> proxy host signifies default 
  +     * credentials, which should be used when no [EMAIL PROTECTED] Credentials 
credentials} 
  +     * have been explictly supplied for the challenging proxy host. Any previous 
  +     * credentials for the given proxy realm on the given proxy host will be 
  +     * overwritten.
  +     * 
        * @param realm the authentication realm
        * @param proxyHost the proxy host
        * @param credentials the authentication credentials for the given realm
  @@ -579,7 +574,8 @@
       }
   
       /**
  -     * Get the Credentials for the proxy with the given authentication realm.
  +     * Get the [EMAIL PROTECTED] Credentials credentials} for the given 
  +     * proxy authentication realm.
        *
        * If the <i>realm</i> exists, return the coresponding credentials.  If the 
        * <i>realm</i> does not exist, return the default Credentials.  If there is 
  @@ -599,8 +595,8 @@
       }
       
       /**
  -     * Get the Credentials for the proxy with the given authentication realm on the 
given
  -     * <i>host</i>.
  +     * Get the [EMAIL PROTECTED] Credentials credentials} for the proxy host with 
the given 
  +     * authentication realm.
        *
        * If the <i>realm</i> exists on <i>host</i>, return the coresponding 
credentials.
        * If the <i>host</i> exists with a <tt>null</tt> <i>realm</i>, return the 
corresponding
  @@ -621,8 +617,10 @@
       }
       
       /**
  -     * Return a string representation of this object.
  -     * @return The string representation.
  +     * Returns a string representation of this HTTP state.
  +     * 
  +     * @return The string representation of the HTTP state.
  +     * 
        * @see java.lang.Object#toString()
        */
       public synchronized String toString() {
  @@ -642,7 +640,7 @@
       }
       
       /**
  -     * Return a string representation of the proxy credentials
  +     * Returns a string representation of the proxy credentials
        * @param proxyCredMap The proxy credentials
        * @return StringBuffer The string representation.
        */
  @@ -663,7 +661,7 @@
       }
       
       /**
  -     *  Return a string representation of the credentials.
  +     * Returns a string representation of the credentials.
        * @param credMap The credentials.
        * @return StringBuffer The string representation.
        */
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to