...
If no username is provided then anonymous
login is attempted using no password.
If no port number is provided. Camel will provide default values according to the protocol. (ftp = 21, sftp = 22)
Examples
ftp://someone@someftpserver.com/public/upload/images/holiday2008?password=secret&binary=true
ftp://someoneelse@someotherftpserver.co.uk:12049/reports/2008/budget.txt?password=secret&binary=false&directory=false
ftp://publicftpserver.com/download
...
And the route using Spring DSL:
Code Block | ||||
---|---|---|---|---|
| ||||
<route>
<from uri="ftp://scott@localhost/public/reports?password=tiger&binary=true&consumer.delay=60000"/>
<to uri="file://target/test-reports"/>
</route>
|
Using expression for filenames
In this sample we want to move consumed files to a backup folder using today's date as a sub foldername:. Notice that the move happens on the remote FTP server. If you want to store the downloaded file on your local disk then route it to the File component as the sample above illustrates.
Code Block | ||||
---|---|---|---|---|
| ||||
from(ftpUrl + "&expression=backup/${date:now:yyyyMMdd}/${file:name}").to("..."); |
...