[ 
https://issues.apache.org/activemq/browse/CAMEL-3309?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63130#action_63130
 ] 

Claus Ibsen commented on CAMEL-3309:
------------------------------------

The next test is to store the files using an absolute path as Bengt did in his 
tests.

So we have this route, notice it stores the file in E:\temp\sample\file2ftp 
folder
{code}
                
from("ftp:localhost/one/two?username=camel&password=camel&recursive=true&noop=true")
                    .to("file:E:/temp/sample/file2ftp")
                    .to("mock:result");
{code}

And the log from File Zilla
{code}
FileZilla Server version 0.9.37 beta
Copyright 2001-2010 by Tim Kosse (tim.ko...@filezilla-project.org)
Connecting to server...
Connected, waiting for authentication
Logged on
(000021)06/11/2010 15:04:06 - (not logged in) (127.0.0.1)> Connected, sending 
welcome message...
(000021)06/11/2010 15:04:06 - (not logged in) (127.0.0.1)> 220-FileZilla Server 
version 0.9.37 beta
(000021)06/11/2010 15:04:06 - (not logged in) (127.0.0.1)> 220-written by Tim 
Kosse (tim.ko...@gmx.de)
(000021)06/11/2010 15:04:06 - (not logged in) (127.0.0.1)> 220 Please visit 
http://sourceforge.net/projects/filezilla/
(000021)06/11/2010 15:04:06 - (not logged in) (127.0.0.1)> USER camel
(000021)06/11/2010 15:04:06 - (not logged in) (127.0.0.1)> 331 Password 
required for camel
(000021)06/11/2010 15:04:06 - (not logged in) (127.0.0.1)> PASS *****
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 230 Logged on
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> TYPE A
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 200 Type set to A
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> PWD
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 257 "/" is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD one
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. "/one" is 
current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD two
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. "/one/two" 
is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> SYST
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 215 UNIX emulated by FileZilla
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> PORT 127,0,0,1,17,94
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 200 Port command successful
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> LIST
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 150 Opening data channel for 
directory list.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 226 Transfer OK
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD sub-a
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. 
"/one/two/sub-a" is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> PORT 127,0,0,1,17,95
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 200 Port command successful
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> LIST
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 150 Opening data channel for 
directory list.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 226 Transfer OK
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CDUP
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 200 CDUP successful. 
"/one/two" is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD sub-b
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. 
"/one/two/sub-b" is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> PORT 127,0,0,1,17,96
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 200 Port command successful
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> LIST
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 150 Opening data channel for 
directory list.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 226 Transfer OK
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CDUP
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 200 CDUP successful. 
"/one/two" is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD /
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. "/" is 
current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> PWD
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 257 "/" is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD one
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. "/one" is 
current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD two
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. "/one/two" 
is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> PORT 127,0,0,1,17,97
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 200 Port command successful
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> RETR foo.txt
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 150 Opening data channel for 
file transfer.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 226 Transfer OK
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD /
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. "/" is 
current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> PWD
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 257 "/" is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD one
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. "/one" is 
current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD two
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. "/one/two" 
is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD sub-a
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. 
"/one/two/sub-a" is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> PORT 127,0,0,1,17,98
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 200 Port command successful
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> RETR a.txt
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 150 Opening data channel for 
file transfer.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 226 Transfer OK
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD /
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. "/" is 
current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> PWD
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 257 "/" is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD one
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. "/one" is 
current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD two
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. "/one/two" 
is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD sub-b
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. 
"/one/two/sub-b" is current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> PORT 127,0,0,1,17,99
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 200 Port command successful
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> RETR b.txt
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 150 Opening data channel for 
file transfer.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 226 Transfer OK
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> CWD /
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 250 CWD successful. "/" is 
current directory.
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> QUIT
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> 221 Goodbye
(000021)06/11/2010 15:04:06 - camel (127.0.0.1)> disconnected.
{code}

And the downloaded file structure is as follows:
{code}
E:\temp\sample\file2ftp>dir /s/b
E:\temp\sample\file2ftp\foo.txt
E:\temp\sample\file2ftp\sub-a
E:\temp\sample\file2ftp\sub-b
E:\temp\sample\file2ftp\sub-a\a.txt
E:\temp\sample\file2ftp\sub-b\b.txt
{code}

As you can see the files are now downloaded to the absolute path and in the 
expected directory structure

> Stepwise change of directory unfit for production (ftp/ftps/sftp)
> -----------------------------------------------------------------
>
>                 Key: CAMEL-3309
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-3309
>             Project: Apache Camel
>          Issue Type: Improvement
>          Components: camel-ftp
>    Affects Versions: 2.5.0
>            Reporter: Bengt Rodehav
>            Assignee: Claus Ibsen
>         Attachments: camel-ftp.patch
>
>
> In Camel 2.5, the logic for changing directory for ftp/ftps/sftp has changed 
> in order to fix the problems discussed in the following thread:
>   
> http://camel.465427.n5.nabble.com/How-to-change-directory-while-using-sftp-component-td2806817.html#a2807611
> In Camel 2.5 changing of the remote directory is now done in a stepwise 
> manner. This is a strategy not fit for production since it assumes that the 
> logged in ftp/ftps/sftp user has access to all intermediate directories all 
> the way down to its home directory. This is rarely the case.
> Also, when testing ftp/sftp on Serv-U, a Windows based ftp/ftps/sftp server, 
> it turns out that it reports the current directory in a "Windows way", e g 
> /C:/temp/servu/user/sample/file2sftp. The topmost folder is not "/" but 
> "/C:". This also breaks the new stepwise way of changing directory since it 
> always tries to change to "/" if an absolute path is used.
> I propose to introduce a configuration property to enable/disable stepwise 
> changing of directories where disabling it should be the default. I will 
> upload a patch shortly.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to