You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-user@jakarta.apache.org by Tiffany Dodge <ti...@ubermind.com> on 2007/03/15 23:54:53 UTC

client webdav lib - resource not found

Hello,

I've run into a problem where slide can't find a file right after it  
has been uploaded.  The file does exist on the DAV server (I  
checked).  FYI, I am using slide 2.1 with Apache 1.3.

Basically, I do this ...
- upload a file
- get the childResources
- and then try to getResource(filename) for the file that I just  
uploaded.

 From my debugging (which could totall be wrong), the problem is in  
WebdavResource.java, in the method setWebdavProperties ...

             int lenDiff = escapedHref.length() - httpURLPath.length();

lenDiff is zero, but the paths are completely different.  For  
example, they could be ...

escapedHref = /webdavtest/abcdefghijklm,
httpURLPath = /webdavtest/uploading/xxy

So the local var "itself" ends up being true in this case and the  
workingResource is not added to the childResources at the end of the  
method, as it should.  That in turn means that the resource cannot be  
found.

Has anyone else experienced this?  If so, what did you do to fix it?   
Any help would be appreciated.

Thanks,
Tiff


Re: Related to [Bug 32886]? - client webdav lib - resource not found

Posted by Tiffany Dodge <ti...@ubermind.com>.
Hello,

Here is the change I am considering ...

CURRENT CODE:
             if (lenDiff == 0) {
                 if ((compareLen == 0 && httpURLPath.equals 
(escapedHref))
                     || httpURLPath.regionMatches(0, escapedHref, 0,  
compareLen))
                 {


MODIFIED CODE:
             if (lenDiff == 0) {
                 if ((compareLen == 0 && httpURLPath.equals 
(escapedHref))
                     || (compareLen != 0 && httpURLPath.regionMatches 
(0, escapedHref, 0, compareLen)))
                 {

I gave it a quick test and it fixed my issue while not breaking other  
stuff (from what I can tell).  Can anyone confirm that this change  
won't break something else?

Thanks,
Tiff

On Mar 16, 2007, at 1:00 PM, Tiffany Dodge wrote:

> Hello,
>
> I sent the forwarded message below to slide-users, but I haven't  
> heard anything so I thought I would try this list with more code- 
> type details.  I believe the problem I'm having is related to [Bug  
> 32886].
>
> http://issues.apache.org/bugzilla/show_bug.cgi?id=32886
>
> Here are some more details on the files listed in the forwarded email.
>
> escapedHref = /webdavtest/abcdefghijklm
> httpURLPath = /webdavtest/uploading/xxy
>
> abcdefghijklm is the file that was uploaded
> xxy is the directory that the file was uploaded to
>
> Other files in xxy were added properly to childResources.  I added  
> several System.out.println statements to the setWebdavProperties  
> method (in WebdavResource.java) and here's what I got (there is  
> info for two files: one that was properly added and one that  
> wasn't) ...
>
> // file was properly added to childResources
> Before if stmts, lenDiff = 4
> escapedHref = /webdavtest/abcdefghijklm1234, httpURLPath = / 
> webdavtest/uploading/xxy
> After if stmts, lenDiff = 4
> compareLen = 0
> httpURLPath.equals(escapedHref) = false
> httpURLPath.regionMatches(0, escapedHref, 0, compareLen) = true
> (compareLen == 0 && httpURLPath.equals(escapedHref)) = false
> itself = false
> Added resource named abcdefghijklm1234 to childResources
>
> // file was NOT properly added to childResources
> Before if stmts, lenDiff = 0
> escapedHref = /webdavtest/abcdefghijklm, httpURLPath = /webdavtest/ 
> uploading/xxy
> After if stmts, lenDiff = 0
> compareLen = 0
> httpURLPath.equals(escapedHref) = false
> httpURLPath.regionMatches(0, escapedHref, 0, compareLen) = true
> (compareLen == 0 && httpURLPath.equals(escapedHref)) = false
> In if stmt body to set status code
> itself = true
> Did NOT add resource named abcdefghijklm to childResources
>
> I'm guessing that "httpURLPath.regionMatches(0, escapedHref, 0,  
> compareLen)" should not have been true but I'm not really sure.   
> Can anyone help me determine how I should change this bit of code ...
>
>
>             // if they are the same length then compare them.
>             if (lenDiff == 0) {
>                 if ((compareLen == 0 && httpURLPath.equals 
> (escapedHref))
>                     || httpURLPath.regionMatches(0, escapedHref, 0,  
> compareLen))
>                 {
>
>
> so that my bug is fixed, but so that I don't break everything else?
>
> Thanks,
> Tiff
>
> Begin forwarded message:
>
>> From: Tiffany Dodge <ti...@ubermind.com>
>> Date: March 15, 2007 4:08:52 PM PDT
>> To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
>> Subject: Re: client webdav lib - resource not found
>> Reply-To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
>>
>> Correcting a typo below (the escapedHref value - removing the comma)
>>
>> On Mar 15, 2007, at 3:54 PM, Tiffany Dodge wrote:
>>
>>> Hello,
>>>
>>> I've run into a problem where slide can't find a file right after  
>>> it has been uploaded.  The file does exist on the DAV server (I  
>>> checked).  FYI, I am using slide 2.1 with Apache 1.3.
>>>
>>> Basically, I do this ...
>>> - upload a file
>>> - get the childResources
>>> - and then try to getResource(filename) for the file that I just  
>>> uploaded.
>>>
>>> From my debugging (which could totall be wrong), the problem is  
>>> in WebdavResource.java, in the method setWebdavProperties ...
>>>
>>>             int lenDiff = escapedHref.length() -  
>>> httpURLPath.length();
>>>
>>> lenDiff is zero, but the paths are completely different.  For  
>>> example, they could be ...
>>>
>>> escapedHref = /webdavtest/abcdefghijklm
>>> httpURLPath = /webdavtest/uploading/xxy
>>>
>>> So the local var "itself" ends up being true in this case and the  
>>> workingResource is not added to the childResources at the end of  
>>> the method, as it should.  That in turn means that the resource  
>>> cannot be found.
>>>
>>> Has anyone else experienced this?  If so, what did you do to fix  
>>> it?  Any help would be appreciated.
>>>
>>> Thanks,
>>> Tiff
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: slide-user-help@jakarta.apache.org
>>
>>
>


Related to [Bug 32886]? - client webdav lib - resource not found

Posted by Tiffany Dodge <ti...@ubermind.com>.
Hello,

I sent the forwarded message below to slide-users, but I haven't  
heard anything so I thought I would try this list with more code-type  
details.  I believe the problem I'm having is related to [Bug 32886].

http://issues.apache.org/bugzilla/show_bug.cgi?id=32886

Here are some more details on the files listed in the forwarded email.

escapedHref = /webdavtest/abcdefghijklm
httpURLPath = /webdavtest/uploading/xxy

abcdefghijklm is the file that was uploaded
xxy is the directory that the file was uploaded to

Other files in xxy were added properly to childResources.  I added  
several System.out.println statements to the setWebdavProperties  
method (in WebdavResource.java) and here's what I got (there is info  
for two files: one that was properly added and one that wasn't) ...

// file was properly added to childResources
Before if stmts, lenDiff = 4
escapedHref = /webdavtest/abcdefghijklm1234, httpURLPath = / 
webdavtest/uploading/xxy
After if stmts, lenDiff = 4
compareLen = 0
httpURLPath.equals(escapedHref) = false
httpURLPath.regionMatches(0, escapedHref, 0, compareLen) = true
(compareLen == 0 && httpURLPath.equals(escapedHref)) = false
itself = false
Added resource named abcdefghijklm1234 to childResources

// file was NOT properly added to childResources
Before if stmts, lenDiff = 0
escapedHref = /webdavtest/abcdefghijklm, httpURLPath = /webdavtest/ 
uploading/xxy
After if stmts, lenDiff = 0
compareLen = 0
httpURLPath.equals(escapedHref) = false
httpURLPath.regionMatches(0, escapedHref, 0, compareLen) = true
(compareLen == 0 && httpURLPath.equals(escapedHref)) = false
In if stmt body to set status code
itself = true
Did NOT add resource named abcdefghijklm to childResources

I'm guessing that "httpURLPath.regionMatches(0, escapedHref, 0,  
compareLen)" should not have been true but I'm not really sure.  Can  
anyone help me determine how I should change this bit of code ...


             // if they are the same length then compare them.
             if (lenDiff == 0) {
                 if ((compareLen == 0 && httpURLPath.equals 
(escapedHref))
                     || httpURLPath.regionMatches(0, escapedHref, 0,  
compareLen))
                 {


so that my bug is fixed, but so that I don't break everything else?

Thanks,
Tiff

Begin forwarded message:

> From: Tiffany Dodge <ti...@ubermind.com>
> Date: March 15, 2007 4:08:52 PM PDT
> To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
> Subject: Re: client webdav lib - resource not found
> Reply-To: "Slide Users Mailing List" <sl...@jakarta.apache.org>
>
> Correcting a typo below (the escapedHref value - removing the comma)
>
> On Mar 15, 2007, at 3:54 PM, Tiffany Dodge wrote:
>
>> Hello,
>>
>> I've run into a problem where slide can't find a file right after  
>> it has been uploaded.  The file does exist on the DAV server (I  
>> checked).  FYI, I am using slide 2.1 with Apache 1.3.
>>
>> Basically, I do this ...
>> - upload a file
>> - get the childResources
>> - and then try to getResource(filename) for the file that I just  
>> uploaded.
>>
>> From my debugging (which could totall be wrong), the problem is in  
>> WebdavResource.java, in the method setWebdavProperties ...
>>
>>             int lenDiff = escapedHref.length() - httpURLPath.length 
>> ();
>>
>> lenDiff is zero, but the paths are completely different.  For  
>> example, they could be ...
>>
>> escapedHref = /webdavtest/abcdefghijklm
>> httpURLPath = /webdavtest/uploading/xxy
>>
>> So the local var "itself" ends up being true in this case and the  
>> workingResource is not added to the childResources at the end of  
>> the method, as it should.  That in turn means that the resource  
>> cannot be found.
>>
>> Has anyone else experienced this?  If so, what did you do to fix  
>> it?  Any help would be appreciated.
>>
>> Thanks,
>> Tiff
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: slide-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: slide-user-help@jakarta.apache.org
>
>


Re: client webdav lib - resource not found

Posted by Tiffany Dodge <ti...@ubermind.com>.
Correcting a typo below (the escapedHref value - removing the comma)

On Mar 15, 2007, at 3:54 PM, Tiffany Dodge wrote:

> Hello,
>
> I've run into a problem where slide can't find a file right after  
> it has been uploaded.  The file does exist on the DAV server (I  
> checked).  FYI, I am using slide 2.1 with Apache 1.3.
>
> Basically, I do this ...
> - upload a file
> - get the childResources
> - and then try to getResource(filename) for the file that I just  
> uploaded.
>
> From my debugging (which could totall be wrong), the problem is in  
> WebdavResource.java, in the method setWebdavProperties ...
>
>             int lenDiff = escapedHref.length() - httpURLPath.length();
>
> lenDiff is zero, but the paths are completely different.  For  
> example, they could be ...
>
> escapedHref = /webdavtest/abcdefghijklm
> httpURLPath = /webdavtest/uploading/xxy
>
> So the local var "itself" ends up being true in this case and the  
> workingResource is not added to the childResources at the end of  
> the method, as it should.  That in turn means that the resource  
> cannot be found.
>
> Has anyone else experienced this?  If so, what did you do to fix  
> it?  Any help would be appreciated.
>
> Thanks,
> Tiff
>


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