You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by ma...@apache.org on 2002/02/22 20:21:11 UTC

cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient URIUtil.java

marcsaeg    02/02/22 11:21:11

  Modified:    httpclient/src/java/org/apache/commons/httpclient
                        URIUtil.java
  Log:
  Added getPath() method.  This is used by the HttpUrlMethod classes.
  
  Revision  Changes    Path
  1.6       +17 -4     jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URIUtil.java
  
  Index: URIUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URIUtil.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- URIUtil.java	5 Jan 2002 11:16:00 -0000	1.5
  +++ URIUtil.java	22 Feb 2002 19:21:11 -0000	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URIUtil.java,v 1.5 2002/01/05 11:16:00 vmassol Exp $
  - * $Revision: 1.5 $
  - * $Date: 2002/01/05 11:16:00 $
  + * $Header: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URIUtil.java,v 1.6 2002/02/22 19:21:11 marcsaeg Exp $
  + * $Revision: 1.6 $
  + * $Date: 2002/02/22 19:21:11 $
    * ====================================================================
    *
    * The Apache Software License, Version 1.1
  @@ -85,7 +85,7 @@
    * @author Remy Maucherat
    * @author Park, Sung-Gu
    * @author Rodney Waldhoff
  - * @version $Revision: 1.5 $ $Date: 2002/01/05 11:16:00 $
  + * @version $Revision: 1.6 $ $Date: 2002/02/22 19:21:11 $
    */
   
   public class URIUtil {
  @@ -534,6 +534,19 @@
               e.printStackTrace();
               return encode(str.getBytes(), safe, spaceAsPlus);
           }
  +    }
  +
  +
  +    /**
  +     *
  +     */
  +    public static final String getPath(String url) throws java.net.MalformedURLException
  +    {
  +        String path = new java.net.URL(url).getPath();
  +        if(path.length() == 0){
  +            path = "/";
  +        }
  +        return path;
       }
   
       // ------------------------------- RFC 2396 Character Sets : Public Methods
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>