> hi remy,
>    Following is the piece of code
>    from the class org.apache.slide.webdav.method.PropFindMethod
>
>                 revisionDescriptor = content.retrieve(slideToken,
>
revisionDescriptors);
>                 isCollection = isCollection(revisionDescriptor);
>                 String path = object.getUri();
>                 String absoluteUri = URLDecode(req.getRequestURI());
>                 String relativePath = requestUri;
>
>                 String toAppend = "";
>                 if (relativePath.length() <= path.length()) {
>                     toAppend = path.substring(relativePath.length());
>                     if ((!absoluteUri.endsWith("/")) &&
>                         (!toAppend.startsWith("/"))) {
>                         toAppend = "/" + toAppend;
>                     }
>                     if (toAppend.equals("/")) {
>                         toAppend = "";
>                     }
>                 }
>
> What is the need for the if condition "relativePath.length() <=
> path.length()" .
> Under what circumstances does the relative path's length lesser than the
> path's length.
> Can you please give me an example of when this condition would become
true.

The path generation code is  bit messy, but appears to be working ok. It
could use some cleanup, though :)

Here, I think it's to avoid some case involving trailing '/' ...

Remy

Reply via email to