commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Marc Borer (JIRA)" <>
Subject [jira] [Commented] (VFS-467) WebDAV: list children returns parent directory instead of ignoring it
Date Wed, 06 Mar 2013 10:26:12 GMT


Jean-Marc Borer commented on VFS-467:

Answer found:

8.3.  URL Handling

   URLs appear in many places in requests and responses.
   Interoperability experience with [RFC2518] showed that many clients
   parsing Multi-Status responses did not fully implement the full
   Reference Resolution defined in Section 5 of [RFC3986].  Thus,
   servers in particular need to be careful in handling URLs in
   responses, to ensure that clients have enough context to be able to
   interpret all the URLs.  The rules in this section apply not only to
   resource URLs in the 'href' element in Multi-Status responses, but
   also to the Destination and If header resource URLs.

   The sender has a choice between two approaches: using a relative
   reference, which is resolved against the Request-URI, or a full URI.
   A server MUST ensure that every 'href' value within a Multi-Status
   response uses the same format.

   WebDAV only uses one form of relative reference in its extensions,
   the absolute path.

      Simple-ref = absolute-URI | ( path-absolute [ "?" query ] )

   The absolute-URI, path-absolute and query productions are defined in
   Sections 4.3, 3.3, and 3.4 of [RFC3986].

   Within Simple-ref productions, senders MUST NOT:

   o  use dot-segments ("." or ".."), or

   o  have prefixes that do not match the Request-URI (using the
      comparison rules defined in Section 3.2.3 of [RFC2616]).

   Identifiers for collections SHOULD end in a '/' character.

8.3.1.  Example - Correct URL Handling

   Consider the collection with the internal
   member URL and the PROPFIND
   request below:


     PROPFIND /sample/ HTTP/1.1
     Depth: 1

   In this case, the server should return two 'href' elements containing

   o  '' and
      '', or

   o  '/sample/' and '/sample/a%20test'

   Note that even though the server may be storing the member resource
   internally as 'a test', it has to be percent-encoded when used inside
   a URI reference (see Section 2.1 of [RFC3986]).  Also note that a
   legal URI may still contain characters that need to be escaped within
   XML character data, such as the ampersand character.

> WebDAV: list children returns parent directory instead of ignoring it
> ---------------------------------------------------------------------
>                 Key: VFS-467
>                 URL:
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0, 2.1
>            Reporter: Jean-Marc Borer
> WebDAV seems to always include the parent folder when returning a list
> of children for a directory. This is due to a wrong test in WebdavFileObject doListChildrenResolved:
> if (isCurrentFile(response.getHref(), name))
> {
>      continue;
> }
> where
> private boolean isCurrentFile(String href, URLFileName fileName)
> {
>    String name = hrefString(fileName);
>    if (href.endsWith("/") && !name.endsWith("/"))
>    { 
>       name += "/"; 
>    }
>    return href.equals(name);
> }
> where the parent dir returned in the WedbDAV response should be ignored. However the
test compares a RELATIVE href (first arg), with an ASBOLUTE href (second arg)

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see:

View raw message