commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oglu...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient HttpClient.java
Date Mon, 21 Oct 2002 14:15:38 GMT
oglueck     2002/10/21 07:15:38

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        HttpClient.java
  Log:
  added getPort, getHost for convenience (contrib by Eric Johnson)
  
  Revision  Changes    Path
  1.59      +24 -4     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.58
  retrieving revision 1.59
  diff -u -r1.58 -r1.59
  --- HttpClient.java	20 Oct 2002 14:14:04 -0000	1.58
  +++ HttpClient.java	21 Oct 2002 14:15:38 -0000	1.59
  @@ -464,4 +464,24 @@
               connection = null;
           }
       }
  +
  +    /**
  +      * Return 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.
  +      */
  +     public String getHost() {
  +         return connection != null ? connection.getHost() : null;
  +     }
  +
  +     /**
  +      * Return 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().
  +      */
  +     public int getPort() {
  +         return connection != null ? connection.getPort() : -1;
  +     }
   }
  
  
  

--
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