commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ajesh babu (Created) (JIRA)" <>
Subject [jira] [Created] (VFS-376) SFTP uri is throwing error when .. is using in path
Date Wed, 02 Nov 2011 12:35:32 GMT
SFTP uri is throwing error when .. is using in path

                 Key: VFS-376
             Project: Commons VFS
          Issue Type: Bug
    Affects Versions: 2.0
            Reporter: Ajesh babu
            Priority: Blocker

We are using apache commons vfs2 for sftp file upload & download , but in one scenario
it is always giving an error like
"SEVERE: FileSystemException ->org.apache.commons.vfs2.FileSystemException: Invalid absolute

The uri is like "sftp://sftpuser:{AFF12398KYUJN982FGTB}@"

The user home directory of sftpuser is 'app/utenti/sftpuser' , we want to use another directory
which is not under app/utenti/sftpuser, so we tried to traverse the parent directory using
../../ but UriParser:normalisePath() method is always giving error ,
in the below code portion

// A '..' element - remove the previous element
                if (startElem == startFirstElem)
                    // Previous element is missing
                    throw new FileSystemException(

But in jdk URI it is saying that

public URI normalize()

    Normalizes this URI's path.

    If this URI is opaque, or if its path is already in normal form, then this URI is returned.
Otherwise a new URI is constructed that is identical to this URI except that its path is computed
by normalizing this URI's path in a manner consistent with RFC 2396, section 5.2, step 6,
sub-steps c through f; that is:


          All "." segments are removed.

          If a ".." segment is preceded by a non-".." segment then both of these segments
are removed. This step is repeated until it is no longer applicable.

          If the path is relative, and if its first segment contains a colon character (':'),
then a "." segment is prepended. This prevents a relative URI with a path such as "a:b/c/d"
from later being re-parsed as an opaque URI with a scheme of "a" and a scheme-specific part
of "b/c/d". (Deviation from RFC 2396) 

    A normalized path will begin with one or more ".." segments if there were insufficient
non-".." segments preceding them to allow their removal. A normalized path will begin with
a "." segment if one was inserted by step 3 above. Otherwise, a normalized path will not contain
any "." or ".." segments.

        A URI equivalent to this URI, but whose path is in normal form

So can you please tell us how can we use ../../ in a uri for traversing to the parent directory.

If we are passing the path like

this it is working fine, in this case 'output' directory is under sftpuser's home directory

Please treat it as urgent and pls help us

Thanks in advance

Ajesh Babu

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


View raw message