This is the same as bug 34910.  startTransaction() fails to encode the path 
befor calling the lock method. 

-----Original Message-----
From: Laurent Michenaud [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 19, 2005 4:10 AM
To: Slide Users Mailing List
Subject: RE: Binding store & rename & accents

I think the problem comes from transaction.

I have created a resource /slide/files/y�

Next, if i execute the following code :

public static void testRenameSimple() throws HttpException, IOException {
        HttpURL oHttpURL = new HttpURL("http://localhost:8082/slide/";);
        oHttpURL.setUserinfo("root", "root");
        WebdavResource oWebdavResource = new WebdavResource(oHttpURL);
        try {
            oWebdavResource.setPath("/slide/files/y�");
        } catch( HttpException e ) {
            e.printStackTrace();
            System.out.println( e.getReasonCode());
        } catch (Exception e) {
            e.printStackTrace();
        }
}

=> No error.

The http request is well encoded :

<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop><D:displayname/><D:getcontentlength/><D:getcontenttype/>
<D:resourcetype/><D:getlastmodified/><D:lockdiscovery/></D:prop>
</D:propfind>PROPFIND /slide/files/y%C3%A9 HTTP/1.1
Authorization: Basic cm9vdDpyb290
Content-Type: text/xml; charset=utf-8
User-Agent: Jakarta Commons-HttpClient/3.0-rc2
Host: localhost:8082
Cookie: $Version=0; JSESSIONID=88EC6B6A6234E029D8053339B6953881; $Path=/slide
Content-Length: 207
Depth: 0



If I had in my code, the notion of transaction :

public static void testRenameSimple() throws HttpException, IOException {
        HttpURL oHttpURL = new HttpURL("http://localhost:8082/slide/";);
        oHttpURL.setUserinfo("root", "root");
        WebdavResource oWebdavResource = new WebdavResource(oHttpURL);
        oWebdavResource.startTransaction("root", 2000);
        try {
            oWebdavResource.setPath("/slide/files/y�");
            oWebdavResource.commitTransaction();
        } catch( HttpException e ) {
            oWebdavResource.abortTransaction();
            e.printStackTrace();
            System.out.println( e.getReasonCode());
        } catch (Exception e) {
            oWebdavResource.abortTransaction();
            e.printStackTrace();
        }
    }

I get :

java.lang.IllegalArgumentException: Invalid uri '/slide/files/y�': escaped 
absolute path not valid
        at 
org.apache.commons.httpclient.HttpMethodBase.<init>(HttpMethodBase.java:219)
        at 
org.apache.webdav.lib.methods.HttpRequestBodyMethodBase.<init>(HttpRequestBodyMethodBase.java:73)
        at 
org.apache.webdav.lib.methods.XMLResponseMethodBase.<init>(XMLResponseMethodBase.java:92)
        at 
org.apache.webdav.lib.methods.UnlockMethod.<init>(UnlockMethod.java:85)
        at 
org.apache.webdav.lib.methods.UnlockMethod.<init>(UnlockMethod.java:69)
        at 
org.apache.webdav.lib.WebdavResource.endTransaction(WebdavResource.java:438)
        at 
org.apache.webdav.lib.WebdavResource.abortTransaction(WebdavResource.java:4370)
        at 
com.a2a.slide.test.TestSlideBindingFactory.testRenameSimple(TestSlideBindingFactory.java:173)
        at 
com.a2a.slide.test.TestSlideBindingFactory.main(TestSlideBindingFactory.java:198)

There is no http request sent.

Adding a transaction for a setPath is stupid.
It is just to show u that there is a problem.


-----Message d'origine-----
De : Jacob Lund [mailto:[EMAIL PROTECTED] Envoy� : mercredi 18 mai 2005 09:32 � 
: Slide Users Mailing List Objet : Re: Binding store & rename & accents

If you are using the files based store and windows then you have to have 
following parameter on you java machine -Dfile.encoding=UTF-8 - otherwise java 
will use local characterset instead of unicode in IO operations.

I am not familiar with the client lib, but I don't think that lib will do the 
UTF-8 conversion for you. If I am correct the you will have to change 
"/slide/files/test���" to "/slide/files/test%c3%a9%c3%a0%c3%b9".

/jacob


----- Original Message -----
From: "Laurent Michenaud" <[EMAIL PROTECTED]>
To: "Slide Users Mailing List" <[email protected]>
Sent: Wednesday, May 18, 2005 9:06 AM
Subject: RE: Binding store & rename & accents


Slide 2.1
Encoding : UTF-8
Client : Java Webdavlib
Store : BindingStore

The code :

HttpURL oHttpURL = new HttpURL("http://localhost:8080/slide";);
oHttpURL.setUserinfo(SLIDE_ADMIN, SLIDE_PASSWORD);
WebdavResource oWebdavResource = new WebdavResource(oHttpURL);
oWebdavResource.startTransaction(SLIDE_ADMIN, SLIDE_TIMEOUT );
if ( oWebdavResource.moveMethod(
"/slide/files/test", "/slide/files/test���")) {
oWebdavResource.commitTransaction();
}
else oWebdavResource.abortTransaction();
oWebdavResource.close();


-----Message d'origine-----
De : Jacob Lund [mailto:[EMAIL PROTECTED]
Envoy� : mercredi 18 mai 2005 08:57
� : Slide Users Mailing List
Objet : Re: Binding store & rename & accents

Sounds like an encoding problem!

What version of slide are you using? What client? What encoding have you
configured?

/jacob

----- Original Message ----- 
From: "Laurent Michenaud" <[EMAIL PROTECTED]>
To: "Slide Users Mailing List" <[email protected]>
Sent: Tuesday, May 17, 2005 12:18 PM
Subject: Binding store & rename & accents


Hi,



I use the binding store.



If I try to rename a resource and the new resource name contains
accents, then

my resource disappears. I can't see it anymore.



In the console, I can see when I access the parent folder of my resource
:

http-8081-Processor20, 17-mai-2005 12:17:31, root, GET, 500 "Internal
Server Error", 16 ms, /files/workspaces



Any idea ?



Thanks



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


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



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to