[prev in list] [next in list] [prev in thread] [next in thread] 

List:       slide-dev
Subject:    Re: cvs commit: jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods
From:       "Eric Johnson" <eric () tibco ! com>
Date:       2003-07-31 18:27:34
[Download RAW message or body]

Juergen,

If I'm not mistaken, your patch completely breaks the changes that Ingo 
Brunberg and I have been wrestling with for the past month.  You can 
review my emails on the topic here:

http://archives.apache.org/eyebrowse/ReadMsg?listName=slide-dev@jakarta.apache.org&msgNo=7205
 http://archives.apache.org/eyebrowse/ReadMsg?listName=slide-dev@jakarta.apache.org&msgNo=7222
 http://archives.apache.org/eyebrowse/ReadMsg?listName=slide-dev@jakarta.apache.org&msgNo=7352


Overridding setPath() to encode the contents causes all sorts of things 
to break.  The assumption by HttpClient and derived methos should be 
that the parameter passed to the constructors for any method is 
*already* encoded.  I have confirmed that my application completely 
falls apart with the latest changes.

I kindly request that you roll back your changes and submit a patch to 
the group for review.

-Eric.

juergen@apache.org wrote:

> juergen     2003/07/31 09:15:19
> 
> Modified:    src/webdav/client/src/org/apache/webdav/lib/methods
> GetMethod.java HeadMethod.java
> HttpRequestBodyMethodBase.java MkcolMethod.java
> PutMethod.java UnlockMethod.java
> Log:
> some more fixes for I18N support. The URL passed to the webdav layer (of http) will \
> be automatically converted into utf-8. 
> Revision  Changes    Path
> 1.19      +35 -25    \
> jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/GetMethod.java 
> Index: GetMethod.java
> ===================================================================
> RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/GetMethod.java,v
>  retrieving revision 1.18
> retrieving revision 1.19
> diff -u -r1.18 -r1.19
> --- GetMethod.java	28 Jul 2003 10:06:59 -0000	1.18
> +++ GetMethod.java	31 Jul 2003 16:15:19 -0000	1.19
> @@ -99,27 +99,37 @@
> super(URLUtil.URLEncode(path, "UTF-8"));
> }
> 
> -// those constructors are not supported by htpp client any more
> -//    /**
> -//     * Method constructor.
> -//     */
> -//    public GetMethod(String path, String tempDir) {
> -//        super(URLUtil.URLEncode(path, "UTF-8"), tempDir);
> -//    }
> -//
> -//
> -//    /**
> -//     * Method constructor.
> -//     */
> -//    public GetMethod(String path, String tempDir, String tempFile) {
> -//        super(URLUtil.URLEncode(path, "UTF-8"), tempDir, tempFile);
> -//    }
> -//
> -//    /**
> -//     * Method constructor.
> -//     */
> -//    public GetMethod(String path, File fileData) {
> -//        super(URLUtil.URLEncode(path, "UTF-8"), fileData);
> -//    }
> +
> +
> +    /**
> +     * Set the path part of my request.
> +     * It is responsibility of the caller to ensure that the path is
> +     * properly encoded (URL safe).
> +     *
> +     * @param path the path to request. The path is expected
> +     *        to be NOT URL-encoded
> +     */
> +    public void setPath(String path ) {
> +        setPath(path, null);
> +    }
> +
> +
> +    /**
> +     * Set the path part of my request.
> +     * It is responsibility of the caller to ensure that the path is
> +     * properly encoded (URL safe).
> +     *
> +     * @param path the path to request. The path is expected
> +     *        to be NOT URL-encoded
> +     * @param enc the encoding used to encode the path. UTF-8 is the default.
> +     */
> +    public void setPath(String path, String enc ) {
> +        if (enc == null) enc = "UTF-8";
> +        super.setPath(URLUtil.URLEncode(path, enc));
> +    }
> +
> +
> +
> +
> }
> 
> 
> 
> 
> 1.14      +35 -3     \
> jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/HeadMethod.java 
> Index: HeadMethod.java
> ===================================================================
> RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/HeadMethod.java,v
>  retrieving revision 1.13
> retrieving revision 1.14
> diff -u -r1.13 -r1.14
> --- HeadMethod.java	28 Jul 2003 10:06:59 -0000	1.13
> +++ HeadMethod.java	31 Jul 2003 16:15:19 -0000	1.14
> @@ -99,5 +99,37 @@
> public HeadMethod(String path) {
> super(URLUtil.URLEncode(path, "UTF-8"));
> }
> +
> +
> +    /**
> +     * Set the path part of my request.
> +     * It is responsibility of the caller to ensure that the path is
> +     * properly encoded (URL safe).
> +     *
> +     * @param path the path to request. The path is expected
> +     *        to be NOT URL-encoded
> +     */
> +    public void setPath(String path ) {
> +        setPath(path, null);
> +    }
> +
> +
> +    /**
> +     * Set the path part of my request.
> +     * It is responsibility of the caller to ensure that the path is
> +     * properly encoded (URL safe).
> +     *
> +     * @param path the path to request. The path is expected
> +     *        to be NOT URL-encoded
> +     * @param enc the encoding used to encode the path. UTF-8 is the default.
> +     */
> +    public void setPath(String path, String enc ) {
> +        if (enc == null) enc = "UTF-8";
> +        super.setPath(URLUtil.URLEncode(path, enc));
> +    }
> +
> +
> +
> +
> }
> 
> 
> 
> 
> 1.9       +33 -3     \
> jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/HttpRequestBodyMethodBase.java
>  
> Index: HttpRequestBodyMethodBase.java
> ===================================================================
> RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/HttpRequestBodyMethodBase.java,v
>  retrieving revision 1.8
> retrieving revision 1.9
> diff -u -r1.8 -r1.9
> --- HttpRequestBodyMethodBase.java	28 Jul 2003 10:06:59 -0000	1.8
> +++ HttpRequestBodyMethodBase.java	31 Jul 2003 16:15:19 -0000	1.9
> @@ -77,6 +77,7 @@
> import org.apache.commons.httpclient.HttpMethodBase;
> import org.apache.commons.httpclient.HttpState;
> import org.apache.commons.httpclient.HttpStatus;
> +import org.apache.util.URLUtil;
> 
> 
> /**
> @@ -298,6 +299,35 @@
> url = null;
> file = null;
> }
> +
> +
> +    /**
> +     * Set the path part of my request.
> +     * It is responsibility of the caller to ensure that the path is
> +     * properly encoded (URL safe).
> +     *
> +     * @param path the path to request. The path is expected
> +     *        to be NOT URL-encoded
> +     */
> +    public void setPath(String path ) {
> +        setPath(path, null);
> +    }
> +
> +
> +    /**
> +     * Set the path part of my request.
> +     * It is responsibility of the caller to ensure that the path is
> +     * properly encoded (URL safe).
> +     *
> +     * @param path the path to request. The path is expected
> +     *        to be NOT URL-encoded
> +     * @param enc the encoding used to encode the path. UTF-8 is the default.
> +     */
> +    public void setPath(String path, String enc ) {
> +        if (enc == null) enc = "UTF-8";
> +        super.setPath(URLUtil.URLEncode(path, enc));
> +    }
> +
> 
> }
> 
> 
> 
> 
> 1.11      +35 -3     \
> jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/MkcolMethod.java 
> Index: MkcolMethod.java
> ===================================================================
> RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/MkcolMethod.java,v
>  retrieving revision 1.10
> retrieving revision 1.11
> diff -u -r1.10 -r1.11
> --- MkcolMethod.java	28 Jul 2003 10:06:59 -0000	1.10
> +++ MkcolMethod.java	31 Jul 2003 16:15:19 -0000	1.11
> @@ -66,6 +66,7 @@
> import java.io.IOException;
> import java.io.InputStream;
> import org.apache.commons.httpclient.HttpMethodBase;
> +import org.apache.util.URLUtil;
> 
> /**
> * The MKCOL method is used to create a new collection. All DAV compliant
> @@ -141,4 +142,35 @@
> public String getName() {
> return "MKCOL";
> }
> +
> +
> +    /**
> +     * Set the path part of my request.
> +     * It is responsibility of the caller to ensure that the path is
> +     * properly encoded (URL safe).
> +     *
> +     * @param path the path to request. The path is expected
> +     *        to be NOT URL-encoded
> +     */
> +    public void setPath(String path ) {
> +        setPath(path, null);
> +    }
> +
> +
> +    /**
> +     * Set the path part of my request.
> +     * It is responsibility of the caller to ensure that the path is
> +     * properly encoded (URL safe).
> +     *
> +     * @param path the path to request. The path is expected
> +     *        to be NOT URL-encoded
> +     * @param enc the encoding used to encode the path. UTF-8 is the default.
> +     */
> +    public void setPath(String path, String enc ) {
> +        if (enc == null) enc = "UTF-8";
> +        super.setPath(URLUtil.URLEncode(path, enc));
> +    }
> +
> +
> +
> }
> 
> 
> 
> 1.17      +35 -3     \
> jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PutMethod.java 
> Index: PutMethod.java
> ===================================================================
> RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/PutMethod.java,v
>  retrieving revision 1.16
> retrieving revision 1.17
> diff -u -r1.16 -r1.17
> --- PutMethod.java	28 Jul 2003 10:06:59 -0000	1.16
> +++ PutMethod.java	31 Jul 2003 16:15:19 -0000	1.17
> @@ -99,5 +99,37 @@
> public PutMethod(String path) {
> super(URLUtil.URLEncode(path, "UTF-8"));
> }
> +
> +
> +    /**
> +     * Set the path part of my request.
> +     * It is responsibility of the caller to ensure that the path is
> +     * properly encoded (URL safe).
> +     *
> +     * @param path the path to request. The path is expected
> +     *        to be NOT URL-encoded
> +     */
> +    public void setPath(String path ) {
> +        setPath(path, null);
> +    }
> +
> +
> +    /**
> +     * Set the path part of my request.
> +     * It is responsibility of the caller to ensure that the path is
> +     * properly encoded (URL safe).
> +     *
> +     * @param path the path to request. The path is expected
> +     *        to be NOT URL-encoded
> +     * @param enc the encoding used to encode the path. UTF-8 is the default.
> +     */
> +    public void setPath(String path, String enc ) {
> +        if (enc == null) enc = "UTF-8";
> +        super.setPath(URLUtil.URLEncode(path, enc));
> +    }
> +
> +
> +
> +
> }
> 
> 
> 
> 
> 1.18      +35 -3     \
> jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/UnlockMethod.java \
>                 
> Index: UnlockMethod.java
> ===================================================================
> RCS file: /home/cvs/jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods/UnlockMethod.java,v
>  retrieving revision 1.17
> retrieving revision 1.18
> diff -u -r1.17 -r1.18
> --- UnlockMethod.java	28 Jul 2003 10:06:58 -0000	1.17
> +++ UnlockMethod.java	31 Jul 2003 16:15:19 -0000	1.18
> @@ -69,6 +69,7 @@
> import org.apache.commons.httpclient.HttpMethodBase;
> import org.apache.commons.httpclient.HttpState;
> import org.apache.commons.httpclient.HttpStatus;
> +import org.apache.util.URLUtil;
> import org.apache.webdav.lib.WebdavState;
> 
> /**
> @@ -169,4 +170,35 @@
> ((WebdavState) state).removeLock(getPath(), lockToken);
> }
> }
> +
> +
> +    /**
> +     * Set the path part of my request.
> +     * It is responsibility of the caller to ensure that the path is
> +     * properly encoded (URL safe).
> +     *
> +     * @param path the path to request. The path is expected
> +     *        to be NOT URL-encoded
> +     */
> +    public void setPath(String path ) {
> +        setPath(path, null);
> +    }
> +
> +
> +    /**
> +     * Set the path part of my request.
> +     * It is responsibility of the caller to ensure that the path is
> +     * properly encoded (URL safe).
> +     *
> +     * @param path the path to request. The path is expected
> +     *        to be NOT URL-encoded
> +     * @param enc the encoding used to encode the path. UTF-8 is the default.
> +     */
> +    public void setPath(String path, String enc ) {
> +        if (enc == null) enc = "UTF-8";
> +        super.setPath(URLUtil.URLEncode(path, enc));
> +    }
> +
> +
> +
> }
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-dev-help@jakarta.apache.org
> 
> 
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: slide-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: slide-dev-help@jakarta.apache.org


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic