camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Barry Kelly (JIRA)" <j...@apache.org>
Subject [jira] [Created] (CAMEL-6254) Sftp changeCurrentDirectory doesn't work for some combinations of state
Date Tue, 09 Apr 2013 10:46:17 GMT
Barry Kelly created CAMEL-6254:
----------------------------------

             Summary: Sftp changeCurrentDirectory doesn't work for some combinations of state
                 Key: CAMEL-6254
                 URL: https://issues.apache.org/jira/browse/CAMEL-6254
             Project: Camel
          Issue Type: Bug
          Components: camel-ftp
    Affects Versions: 2.10.4
         Environment: Linux, OpenSSH sftp
            Reporter: Barry Kelly


The changeCurrentDirectory function in SftpOperations doesn't work correctly for certain combinations
of state. It appears as a failure to change directory, to some directory with the first letter
missing; e.g. failed to chdir to 'ploads', when current directory is '/uploads' and target
directory is '/'.

The code can't work:

        if (getCurrentDirectory().startsWith(path)) {
            // use relative path
            String p = getCurrentDirectory().substring(path.length());
            if (p.length() == 0) {
                return;
            }
            // the first character must be '/' and hence removed
            path = UP_DIR_PATTERN.matcher(p).replaceAll("/..").substring(1);
        }

If getCurrentDirectory() is "/uploads", and path is "/", following this logic through, path
will end up as "ploads". This fails later.

--
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: http://www.atlassian.com/software/jira

Mime
View raw message