Hello Eric, This implication was not obvious to me, sorry if I have created any inconvenience. I am currently trying to get the I18N test suite up and running again (xml test suite with t-processor). During those tests I noticed, that the URL is not encoded any more during transport to the server.
The new HttpClient expects all URLs already encoded, it does no extra encoding. The WebDAV client API did the encoding as a service for the calling API, at least some time ago. To my understanding, I thought those were the patches applied to e.g. PutMethod described in the mentioned e-mails (the path received in the PutMethod constructor is now utf-8 encoded). I think we should discuss our expectations about the xxxMethod classes: 1) Would those classes convert ALL urls to UTF-8 2) Would those classes convert NO urls to UTF-8 [this is the way HttpClient works] 3) Would some methods of those classes convert urls to UTF-8. I will remove my changes. Would it create a big problem, if this is done on Monday (as I will be at my computer again only late today)? Best regards Juergen -----Original Message----- From: Eric Johnson [mailto:[EMAIL PROTECTED] Sent: Donnerstag, 31. Juli 2003 20:28 To: Slide Developers Mailing List Cc: [EMAIL PROTECTED] Subject: Re: cvs commit: jakarta-slide/src/webdav/client/src/org/apache/webdav/lib/methods GetMethod.java HeadMethod.java HttpRequestBodyMethodBase.java MkcolMethod.java PutMethod.java UnlockMethod.java 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/[EMAIL PROTECTED] he.org&msgNo=7205 http://archives.apache.org/eyebrowse/[EMAIL PROTECTED] he.org&msgNo=7222 http://archives.apache.org/eyebrowse/[EMAIL PROTECTED] he.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. [EMAIL PROTECTED] 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/HttpReques tBodyMethodBase.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/MkcolMetho d.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/UnlockMeth od.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: [EMAIL PROTECTED] >For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
