Bug 34950 - Copy and move method does not clean query parameters
Summary: Copy and move method does not clean query parameters
Status: NEW
Alias: None
Product: Slide
Classification: Unclassified
Component: WebDAV Server (show other bugs)
Version: 2.1
Hardware: All All
: P2 major (vote)
Target Milestone: ---
Assignee: Slide Developer List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-05-18 11:03 UTC by Marco Avila
Modified: 2005-05-19 05:36 UTC (History)
0 users



Attachments
Added new method (18.69 KB, text/x-java)
2005-05-18 17:48 UTC, Marco Avila
Details
added the call to the methods (29.80 KB, text/x-java)
2005-05-18 17:57 UTC, Marco Avila
Details
cleans the sourceUri and destinationUri from query parameters (29.87 KB, text/x-java)
2005-05-19 13:35 UTC, Marco Avila
Details
cleans sourceUri and destinationUri from query parameters (26.31 KB, text/x-java)
2005-05-19 13:36 UTC, Marco Avila
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Avila 2005-05-18 11:03:41 UTC
Consider the following piece of code:
String uploadDir = "/home/mavila/temp";
String uploadFile = "globalSettings.xml";
webdavModule.put(uploadDir,uploadFile,"files/globalSettings.xml?param1=value1&param2=value2");
String mycopyFile = "files/globalSettingsCOPY.xml";
webdavModule.copy("files/globalSettings.xml?param1=value1&param2=value2",mycopyFile);


Everything works fine for the put method, all after the "?" is ignored and is
just stored the file, in this case "globalSettings.xml".

Now, we try to use the copy method with the same parameters, in this case the
server believes that the file is the complete string with the parameters, as far
as I can see this is not consistent.
I have debugged the code, seems that in class
org.apache.slide.webdav.method.CopyMethod this is is called

..
macro.copy(slideToken, sourceUri, destinationUri, macroParameters, this, this,
null, this);
...

I don't know very much the architecture of the server, I have not had time to
see a class diagram but before calling the method copy a clean up of the
sourceUri and destinationUri should be done.
Comment 1 Marco Avila 2005-05-18 17:48:08 UTC
Created attachment 15071 [details]
Added new method

Added a method to clean a String from query parameters
Comment 2 Marco Avila 2005-05-18 17:57:07 UTC
Created attachment 15072 [details]
added the call to the methods

Added these statements that use the method implemented in WebdavUtils, this
works for me, should be merged in the code and tested.

sourceUri = WebdavUtils.cleanParameterString(sourceUri);
destinationUri = WebdavUtils.cleanParameterString(destinationUri);
Comment 3 Marco Avila 2005-05-19 13:31:39 UTC
Also the move method does not clean the sourceUri and destinationUri, in
copyMethod.java I have moved the calls to clean the string at the top of the
executeRequest method and also implemented in the moveMethod as well, I will
attache the two file.
Comment 4 Marco Avila 2005-05-19 13:35:28 UTC
Created attachment 15079 [details]
cleans the sourceUri and destinationUri from query parameters

Added at the top of executeRequest method
Comment 5 Marco Avila 2005-05-19 13:36:57 UTC
Created attachment 15080 [details]
cleans sourceUri and destinationUri from query parameters

cleans sourceUri and destinationUri from query parameters, it is implemented in
the top of method executeRequest