commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jeri...@apache.org
Subject cvs commit: jakarta-commons/httpclient/src/java/org/apache/commons/httpclient URI.java
Date Tue, 29 Oct 2002 13:52:10 GMT
jericho     2002/10/29 05:52:10

  Modified:    httpclient/src/java/org/apache/commons/httpclient URI.java
  Log:
  - Add  the setXxxQuery and setXxxFragment methods to support escaped
     query and fragment... mostly for developer serviceableness.
  - Remove the embeded code for debug use.
  
  Revision  Changes    Path
  1.11      +67 -25    jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URI.java
  
  Index: URI.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URI.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- URI.java	26 Oct 2002 17:50:56 -0000	1.10
  +++ URI.java	29 Oct 2002 13:52:09 -0000	1.11
  @@ -584,12 +584,6 @@
        */
       protected static char[] rootPath = { '/' };
   
  -
  -    /**
  -     * The debug.
  -     */
  -    protected static int debug = 0;
  -
       // ---------------------- Generous characters for each component validation
   
       /**
  @@ -2849,6 +2843,37 @@
       // -------------------------------------------------------------- The query 
   
       /**
  +     * Set the raw-escaped query.
  +     *
  +     * @param escapedQuery the raw-escaped query
  +     * @exception URIException escaped query not valid
  +     * @throws NullPointerException null query
  +     */
  +    public void setRawQuery(char[] escapedQuery) throws URIException {
  +        if (!validate(escapedQuery, query))
  +            throw new URIException("escaped query not valid");
  +        _query = escapedQuery;
  +        setUriReference();
  +    }
  +
  +
  +    /**
  +     * Set the escaped query string.
  +     *
  +     * @param escapedQuery the escaped query string
  +     * @exception URIException escaped query not valid
  +     * @throws NullPointerException null query
  +     */
  +    public void setEscapedQuery(String escapedQuery) throws URIException {
  +        char[] querySequence = escapedQuery.toCharArray();
  +        if (!validate(querySequence, query))
  +            throw new URIException("escaped query not valid");
  +        _query = querySequence;
  +        setUriReference();
  +    }
  +
  +
  +    /**
        * Set the query.
        *
        * @param query the query string.
  @@ -2898,10 +2923,38 @@
       // ----------------------------------------------------------- The fragment 
   
       /**
  +     * Set the raw-escaped fragment.
  +     *
  +     * @param escapedFragment the raw-escaped fragment
  +     * @exception URIException escaped fragment not valid
  +     * @throws NullPointerException null fragment
  +     */
  +    public void setRawFragment(char[] escapedFragment) throws URIException {
  +        if (!validate(escapedFragment, fragment))
  +            throw new URIException("escaped fragment not valid");
  +        _fragment = escapedFragment;
  +        setUriReference();
  +    }
  +
  +
  +    /**
  +     * Set the escaped fragment string.
  +     *
  +     * @param escapedFragment the escaped fragment string
  +     * @exception URIException escaped fragment not valid
  +     * @throws NullPointerException null fragment
  +     */
  +    public void setEscapedFragment(String escapedFragment) throws URIException {
  +        char[] fragmentSequence = escapedFragment.toCharArray();
  +        if (!validate(fragmentSequence, fragment))
  +            throw new URIException("escaped fragment not valid");
  +        _fragment = fragmentSequence;
  +        setUriReference();
  +    }
  +
  +
  +    /**
        * Set the fragment.
  -     * <p>
  -     * An empty URI reference represents the base URI of the current document
  -     * and should be replaced by that URI when transformed into a request.
        *
        * @param the fragment string.
        * @exception URIException
  @@ -3034,16 +3087,6 @@
   
   
       /**
  -     * Set debug mode
  -     *
  -     * @param level the level of debug mode
  -     */
  -    public void setDebug(int level) {
  -        debug = level;
  -    }
  -
  -
  -    /**
        * Test if the first array is equal to the second array.
        *
        * @param first the first character array
  @@ -3273,8 +3316,7 @@
        * a given locale.  Supports all locales recognized in JDK 1.1.
        * <p>
        * The distribution of this class is Servlets.com.    It was originally
  -     * written by Jason Hunter [jhunter@acm.org] and used by the Jakarta commons
  -     * HttpClient and Slide project with permission.
  +     * written by Jason Hunter [jhunter at acm.org] with permission.
        */
       public static class LocaleToCharsetMap {
   
  
  
  

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