camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "willem jiang (Confluence)" <conflue...@apache.org>
Subject [CONF] Apache Camel > FTP2
Date Fri, 05 Jul 2013 01:41:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/en/2176/1/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/FTP2">FTP2</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~njiang">willem jiang</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >| {{knownHostsFile}} | {{null}} | *SFTP only:* Sets the {{known_hosts}} file, so that the SFTP endpoint can do host key verification. | <br>| {{knownHostsUri}} | {{null}} | *SFTP only:* *Camel 2.11.1:* Sets the {{known_hosts}} file (loaded from classpath by default), so that the SFTP endpoint can do host key verification. | <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">| {{keyPair}} | {{null}} | *SFTP only:* *Camel 2.12.0:* Sets the Java KeyPair for SSH public key authentication, it supports DSA or RSA keys. | <br></td></tr>
            <tr><td class="diff-unchanged" >| {{privateKeyFile}} | {{null}} | *SFTP only:* Set the private key file to that the SFTP endpoint can do private key verification. | <br>| {{privateKeyUri}} | {{null}} | *SFTP only:* *Camel 2.11.1:* Set the private key file (loaded from classpath by default) to that the SFTP endpoint can do private key verification. | <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="FTP2-FTP%2FSFTP%2FFTPSComponent"></a>FTP/SFTP/FTPS Component</h2>

<p>This component provides access to remote file systems over the FTP and SFTP protocols.</p>

<p>Maven users will need to add the following dependency to their <tt>pom.xml</tt> for this component:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
&lt;dependency&gt;
    &lt;groupId&gt;org.apache.camel&lt;/groupId&gt;
    &lt;artifactId&gt;camel-ftp&lt;/artifactId&gt;
    &lt;version&gt;x.x.x&lt;/version&gt;
    &lt;!-- use the same version as your Camel core version --&gt;
&lt;/dependency&gt;
</pre>
</div></div>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>More options</b><br />See <a href="/confluence/display/CAMEL/File2" title="File2">File</a> for more options as all the options from <a href="/confluence/display/CAMEL/File2" title="File2">File</a> is inherited.</td></tr></table></div>

<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Consuming from remote FTP server</b><br />Make sure you read the section titled <em>Default when consuming files</em> further below for details related to consuming files.</td></tr></table></div>

<h3><a name="FTP2-URIformat"></a>URI format</h3>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
ftp://[username@]hostname[:port]/directoryname[?options]
sftp://[username@]hostname[:port]/directoryname[?options]
ftps://[username@]hostname[:port]/directoryname[?options]
</pre>
</div></div>

<p>Where <b>directoryname</b> represents the underlying directory. Can contain nested folders.</p>

<p>If no <b>username</b> is provided, then <tt>anonymous</tt> login is attempted using no password.<br/>
If no <b>port</b> number is provided, Camel will provide default values according to the protocol (ftp = 21, sftp = 22, ftps = 2222).</p>

<p>You can append query options to the URI in the following format, <tt>?option=value&amp;option=value&amp;...</tt></p>

<p>This component uses two different libraries for the actual FTP work. FTP and FTPS uses <a href="http://commons.apache.org/net/" class="external-link" rel="nofollow">Apache Commons Net</a> while SFTP uses <a href="http://www.jcraft.com/jsch/" class="external-link" rel="nofollow">JCraft JSCH</a>.</p>

<p>The FTPS component is only available in Camel 2.2 or newer.<br/>
FTPS (also known as FTP Secure) is an extension to FTP that adds support for the Transport Layer Security (TLS) and the Secure Sockets Layer (SSL) cryptographic protocols.</p>

<h3><a name="FTP2-URIOptions"></a>URI Options</h3>

<p>The options below are exclusive for the FTP component.</p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>More options</b><br />See <a href="/confluence/display/CAMEL/File2" title="File2">File</a> for more options as all the options from <a href="/confluence/display/CAMEL/File2" title="File2">File</a> is inherited.</td></tr></table></div>

<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Name </th>
<th class='confluenceTh'> Default Value </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>username</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Specifies the username to use to log in to the remote file systen. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>password</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> Specifies the password to use to log in to the remote file system. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>binary</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> Specifies the file transfer mode, BINARY or ASCII. Default is ASCII (<tt>false</tt>). </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>disconnect</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> <b>Camel 2.2:</b> Whether or not to disconnect from remote FTP server right after use. Can be used for both consumer and producer. Disconnect will only disconnect the current connection to the FTP server. If you have a consumer which you want to stop, then you need to stop the consumer/route instead. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>localWorkDirectory</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> When consuming, a local work directory can be used to store the remote file content directly in local files, to avoid loading the content into memory. This is beneficial, if you consume a very big remote file and thus can conserve memory. See below for more details. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>passiveMode</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> <b>FTP and FTPS only</b>: Specifies whether to use passive mode connections. Default is active mode (<tt>false</tt>). </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>securityProtocol</tt> </td>
<td class='confluenceTd'> <tt>TLS</tt> </td>
<td class='confluenceTd'> <b>FTPS only:</b> Sets the underlying security protocol. The following values are defined: <br class="atl-forced-newline" />
<tt>TLS</tt>: Transport Layer Security <br class="atl-forced-newline" />
<tt>SSL</tt>: Secure Sockets Layer </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>disableSecureDataChannelDefaults</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> <b>Camel 2.4: FTPS only</b>: Whether or not to disable using default values for <tt>execPbsz</tt> and <tt>execProt</tt> when using secure data transfer. You can set this option to <tt>true</tt> if you want to be in absolute full control what the options <tt>execPbsz</tt> and <tt>execProt</tt> should be used. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>download</tt> </td>
<td class='confluenceTd'> <tt>true</tt> </td>
<td class='confluenceTd'> <b>Camel 2.11:</b> Whether the FTP consumer should download the file. If this option is set to <tt>false</tt>, then the message body will be <tt>null</tt>, but the consumer will still trigger a Camel <a href="/confluence/display/CAMEL/Exchange" title="Exchange">Exchange</a> that has details about the file such as file name, file size, etc. It's just that the file will not be downloaded. </td>
</tr>
<tr>
<td class='confluenceTd'> streamDownload<br class="atl-forced-newline" /> </td>
<td class='confluenceTd'> false </td>
<td class='confluenceTd'> <b>Camel 2.11:</b>&nbsp;Whether the consumer should download the entire file up front, the default behavior, or if it should pass an InputStream&nbsp;read from the remote resource rather than an in-memory array as the in body of the&nbsp;Camel&nbsp;<a href="/confluence/display/CAMEL/Exchange" title="Exchange">Exchange</a>. &nbsp;This option is ignored if download&nbsp;is false&nbsp;or is localWorkDirectory is provided. &nbsp;This option is useful for working with large remote files. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>execProt</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>Camel 2.4: FTPS only</b>: Will by default use option <tt>P</tt> if secure data channel defaults hasn't been disabled. Possible values are: <br class="atl-forced-newline" />
<tt>C</tt>: Clear <br class="atl-forced-newline" />
<tt>S</tt>: Safe (SSL protocol only) <br class="atl-forced-newline" />
<tt>E</tt>: Confidential (SSL protocol only) <br class="atl-forced-newline" />
<tt>P</tt>: Private </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>execPbsz</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>Camel 2.4: FTPS only</b>: This option specifies the buffer size of the secure data channel. If option <tt>useSecureDataChannel</tt> has been enabled and this option has not been explicit set, then value <tt>0</tt> is used. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>isImplicit</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> <b>FTPS only:</b> Sets the security mode(implicit/explicit). Default is explicit (<tt>false</tt>). </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>knownHostsFile</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>SFTP only:</b> Sets the <tt>known_hosts</tt> file, so that the SFTP endpoint can do host key verification. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>knownHostsUri</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>SFTP only:</b> <b>Camel 2.11.1:</b> Sets the <tt>known_hosts</tt> file (loaded from classpath by default), so that the SFTP endpoint can do host key verification. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>keyPair</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>SFTP only:</b> <b>Camel 2.12.0:</b> Sets the Java KeyPair for SSH public key authentication, it supports DSA or RSA keys. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>privateKeyFile</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>SFTP only:</b> Set the private key file to that the SFTP endpoint can do private key verification. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>privateKeyUri</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>SFTP only:</b> <b>Camel 2.11.1:</b> Set the private key file (loaded from classpath by default) to that the SFTP endpoint can do private key verification. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>privateKey</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>SFTP only:</b> <b>Camel 2.11.1:</b> Set the private key as byte[] to that the SFTP endpoint can do private key verification. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>privateKeyFilePassphrase</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>SFTP only:</b> <b>Deprecated:</b> use <tt>privateKeyPassphrase</tt> instead. Set the private key file passphrase to that the SFTP endpoint can do private key verification. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>privateKeyPassphrase</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>SFTP only:</b> <b>Camel 2.11.1:</b> Set the private key file passphrase to that the SFTP endpoint can do private key verification. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ciphers</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>Camel 2.8.2, 2.9: SFTP only</b> Set a comma separated list of ciphers that will be used in order of preference. Possible cipher names are defined by <a href="http://www.jcraft.com/jsch/" class="external-link" rel="nofollow">JCraft JSCH</a>. Some examples include: aes128-ctr,aes128-cbc,3des-ctr,3des-cbc,blowfish-cbc,aes192-cbc,aes256-cbc. If not specified the default list from JSCH will be used. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>fastExistsCheck</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> <b>Camel 2.8.2, 2.9:</b> If set this option to be true, camel-ftp will use the list file directly to check if the file exists. Since some FTP server may not support to list the file directly, if the option is false, camel-ftp will use the old way to list the directory and check if the file exists. Note from <b>Camel 2.10.1</b> onwards this option also influences <tt>readLock=changed</tt> to control whether it performs a fast check to update file information or not. This can be used to speed up the process if the FTP server has a lot of files. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>strictHostKeyChecking</tt> </td>
<td class='confluenceTd'> <tt>no</tt> </td>
<td class='confluenceTd'> <b>SFTP only:</b> <b>Camel 2.2:</b> Sets whether to use strict host key checking. Possible values are: <tt>no</tt>, <tt>yes</tt> and <tt>ask</tt>. <tt>ask</tt> does not make sense to use as Camel cannot answer the question for you as its meant for human intervention. <b>Note:</b> The default in Camel 2.1 and below was <tt>ask</tt>. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>maximumReconnectAttempts</tt> </td>
<td class='confluenceTd'> <tt>3</tt> </td>
<td class='confluenceTd'> Specifies the maximum reconnect attempts Camel performs when it tries to connect to the remote FTP server. Use 0 to disable this behavior. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>reconnectDelay</tt> </td>
<td class='confluenceTd'> <tt>1000</tt> </td>
<td class='confluenceTd'> Delay in millis Camel will wait before performing a reconnect attempt. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>connectTimeout</tt> </td>
<td class='confluenceTd'> <tt>10000</tt> </td>
<td class='confluenceTd'> <b>Camel 2.4:</b> Is the connect timeout in millis. This corresponds to using <tt>ftpClient.connectTimeout</tt> for the FTP/FTPS. For SFTP this option is also used when attempting to connect. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>soTimeout</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>FTP and FTPS Only:</b> <b>Camel 2.4:</b> Is the <tt>SocketOptions.SO_TIMEOUT</tt> value in millis. Note SFTP will automatic use the <tt>connectTimeout</tt> as the <tt>soTimeout</tt>. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>timeout</tt> </td>
<td class='confluenceTd'> <tt>30000</tt> </td>
<td class='confluenceTd'> <b>FTP and FTPS Only:</b> <b>Camel 2.4:</b> Is the data timeout in millis. This corresponds to using <tt>ftpClient.dataTimeout</tt> for the FTP/FTPS. For SFTP there is no data timeout. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>throwExceptionOnConnectFailed</tt> </td>
<td class='confluenceTd'> <tt>false</tt> </td>
<td class='confluenceTd'> <b>Camel 2.5:</b> Whether or not to thrown an exception if a successful connection and login could not be establish. This allows a custom <tt>pollStrategy</tt> to deal with the exception, for example to stop the consumer or the likes. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>siteCommand</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>FTP and FTPS Only:</b> <b>Camel 2.5:</b> To execute site commands after successful login. Multiple site commands can be separated using a new line character (\n). Use <tt>help site</tt> to see which site commands your FTP server supports. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>stepwise</tt> </td>
<td class='confluenceTd'> <tt>true</tt> </td>
<td class='confluenceTd'> <b>Camel 2.6:</b> Whether or not stepwise traversing directories should be used or not. Stepwise means that it will CD one directory at a time. See more details below. You can disable this in case you can't use this approach. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>separator</tt> </td>
<td class='confluenceTd'> <tt>Auto</tt> </td>
<td class='confluenceTd'> <b>Camel 2.6:</b> Dictates what path separator char to use when uploading files. <tt>Auto</tt> = Use the path provided without altering it. <tt>UNIX</tt> = Use unix style path separators. <tt>Windows</tt> = Use Windows style path separators. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>chmod</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>SFTP Producer Only:</b> <b>Camel 2.9:</b> Allows you to set chmod on the stored file. For example <tt>chmod=640</tt>. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>compression</tt> </td>
<td class='confluenceTd'> 0 </td>
<td class='confluenceTd'> <b>SFTP Only:</b> <b>Camel 2.8.3/2.9:</b> To use compression. Specify a level from 1 to 10. <b>Important:</b> You must manually add the needed JSCH zlib JAR to the classpath for compression support. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ftpClient</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>FTP and FTPS Only:</b> <b>Camel 2.1:</b> Allows you to use a custom <tt>org.apache.commons.net.ftp.FTPClient</tt> instance. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ftpClientConfig</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>FTP and FTPS Only:</b> <b>Camel 2.1:</b> Allows you to use a custom <tt>org.apache.commons.net.ftp.FTPClientConfig</tt> instance. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>serverAliveInterval</tt> </td>
<td class='confluenceTd'> <tt>0</tt> </td>
<td class='confluenceTd'> <b>SFTP Only:</b> <b>Camel 2.8</b> Allows you to set the serverAliveInterval of the sftp session </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>serverAliveCountMax</tt> </td>
<td class='confluenceTd'> <tt>1</tt> </td>
<td class='confluenceTd'> <b>SFTP Only:</b> <b>Camel 2.8</b> Allows you to set the serverAliveCountMax  of the sftp session </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ftpClient.trustStore.file</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>FTPS Only:</b> Sets the trust store file, so that the FTPS client can look up for trusted certificates. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ftpClient.trustStore.type</tt> </td>
<td class='confluenceTd'> <tt>JKS</tt> </td>
<td class='confluenceTd'> <b>FTPS Only:</b> Sets the trust store type. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ftpClient.trustStore.algorithm</tt> </td>
<td class='confluenceTd'> <tt>SunX509</tt> </td>
<td class='confluenceTd'> <b>FTPS Only:</b> Sets the trust store algorithm. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ftpClient.trustStore.password</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>FTPS Only:</b> Sets the trust store password. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ftpClient.keyStore.file</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>FTPS Only:</b> Sets the key store file, so that the FTPS client can look up for the private certificate. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ftpClient.keyStore.type</tt> </td>
<td class='confluenceTd'> <tt>JKS</tt> </td>
<td class='confluenceTd'> <b>FTPS Only:</b> Sets the key store type. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ftpClient.keyStore.algorithm</tt> </td>
<td class='confluenceTd'> <tt>SunX509</tt> </td>
<td class='confluenceTd'> <b>FTPS Only:</b> Sets the key store algorithm. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ftpClient.keyStore.password</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>FTPS Only:</b> Sets the key store password. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>ftpClient.keyStore.keyPassword</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>FTPS Only:</b> Sets the private key password. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>sslContextParameters</tt> </td>
<td class='confluenceTd'> <tt>null</tt> </td>
<td class='confluenceTd'> <b>FTPS Only:</b> <b>Camel 2.9:</b> Reference to a <tt>org.apache.camel.util.jsse.SSLContextParameters</tt> in the <a href="http://camel.apache.org/registry.html" class="external-link" rel="nofollow">Registry</a>.&nbsp; This reference overrides any configured SSL related options on ftpClient as well as the securityProtocol (SSL, TLS, etc.) set on FtpsConfiguration.&nbsp; See <a href="/confluence/display/CAMEL/Camel+Configuration+Utilities" title="Camel Configuration Utilities">Using the JSSE Configuration Utility</a>. </td>
</tr>
</tbody></table>
</div>
</div>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>FTPS component default trust store</b><br />When using the <tt>ftpClient.</tt> properties related to SSL with the FTPS component, the trust store accept all certificates. If you only want trust selective certificates, you have to configure the trust store with the <tt>ftpClient.trustStore.xxx</tt> options or by configuring a custom <tt>ftpClient</tt>.

<p>When using <tt>sslContextParameters</tt>, the trust store is managed by the configuration of the provided SSLContextParameters instance.</p></td></tr></table></div>

<p>You can configure additional options on the <tt>ftpClient</tt> and <tt>ftpClientConfig</tt> from the URI directly by using the <tt>ftpClient.</tt> or <tt>ftpClientConfig.</tt> prefix.</p>

<p>For example to set the <tt>setDataTimeout</tt> on the <tt>FTPClient</tt> to 30 seconds you can do:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
from("ftp://foo@myserver?password=secret&amp;ftpClient.dataTimeout=30000").to("bean:foo");
</pre>
</div></div>

<p>You can mix and match and have use both prefixes, for example to configure date format or timezones.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
from("ftp://foo@myserver?password=secret&amp;ftpClient.dataTimeout=30000&amp;ftpClientConfig.serverLanguageCode=fr").to("bean:foo");
</pre>
</div></div>

<p>You can have as many of these options as you like.</p>

<p>See the documentation of the <a href="http://commons.apache.org/net/api-2.2/org/apache/commons/net/ftp/FTPClientConfig.html" class="external-link" rel="nofollow">Apache Commons FTP FTPClientConfig</a> for possible options and more details.<br/>
And as well for <a href="http://commons.apache.org/net/api-2.2/org/apache/commons/net/ftp/FTPClient.html" class="external-link" rel="nofollow">Apache Commons FTP FTPClient</a>.</p>

<p>If you do not like having many and long configuration in the url you can refer to the <tt>ftpClient</tt> or <tt>ftpClientConfig</tt> to use by letting Camel lookup in the <a href="/confluence/display/CAMEL/Registry" title="Registry">Registry</a> for it.</p>

<p>For example:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
   &lt;bean id="myConfig" class="org.apache.commons.net.ftp.FTPClientConfig"&gt;
       &lt;property name="lenientFutureDates" value="true"/&gt;
       &lt;property name="serverLanguageCode" value="fr"/&gt;
   &lt;/bean&gt;
</pre>
</div></div>

<p>And then let Camel lookup this bean when you use the # notation in the url.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
from("ftp://foo@myserver?password=secret&amp;ftpClientConfig=#myConfig").to("bean:foo");
</pre>
</div></div>


<h3><a name="FTP2-MoreURIoptions"></a>More URI options</h3>
<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>See <a href="/confluence/display/CAMEL/File2" title="File2">File2</a> as all the options there also applies for this component.</td></tr></table></div>


<h3><a name="FTP2-Examples"></a>Examples</h3>

<p><tt><a href="ftp://someone@someftpserver.com/public/upload/images/holiday2008?password=secret&amp;binary=true" class="external-link" rel="nofollow">ftp://someone@someftpserver.com/public/upload/images/holiday2008?password=secret&amp;binary=true</a></tt><br/>
<tt><a href="ftp://someoneelse@someotherftpserver.co.uk:12049/reports/2008/password=secret&amp;binary=false" class="external-link" rel="nofollow">ftp://someoneelse@someotherftpserver.co.uk:12049/reports/2008/password=secret&amp;binary=false</a></tt><br/>
<tt><a href="ftp://publicftpserver.com/download" class="external-link" rel="nofollow">ftp://publicftpserver.com/download</a></tt></p>

<div class='panelMacro'><table class='warningMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/forbidden.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>FTP Consumer does not support concurrency</b><br />The FTP consumer (with the same endpoint) does not support concurrency (the backing FTP client is not thread safe).<br/>
You can use multiple FTP consumers to poll from different endpoints. It is only a single endpoint that does not support concurrent consumers.

<p>The FTP producer does <b>not</b> have this issue, it supports concurrency.</p></td></tr></table></div>

<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>More information</b><br />This component is an extension of the <a href="/confluence/display/CAMEL/File2" title="File2">File</a> component. So there are more samples and details on the <a href="/confluence/display/CAMEL/File2" title="File2">File</a> component page.</td></tr></table></div>

<h3><a name="FTP2-Defaultwhenconsumingfiles"></a>Default when consuming files</h3>

<p>The <a href="/confluence/display/CAMEL/FTP2" title="FTP2">FTP</a> consumer will by default leave the consumed files untouched on the remote FTP server. You have to configure it explicitly if you want it to delete the files or move them to another location. For example you can use <tt>delete=true</tt> to delete the files, or use <tt>move=.done</tt> to move the files into a hidden done sub directory.</p>

<p>The regular <a href="/confluence/display/CAMEL/File2" title="File2">File</a> consumer is different as it will by default move files to a <tt>.camel</tt> sub directory. The reason Camel does <b>not</b> do this by default for the FTP consumer is that it may lack permissions by default to be able to move or delete files.</p>

<h4><a name="FTP2-limitations"></a>limitations</h4>

<p>The option <b>readLock</b> can be used to force Camel <b>not</b> to consume files that is currently in the progress of being written. However, this option is turned off by default, as it requires that the user has write access. See the options table at <a href="/confluence/display/CAMEL/File2" title="File2">File2</a> for more details about read locks.<br/>
There are other solutions to avoid consuming files that are currently being written over FTP; for instance, you can write to a temporary destination and move the file after it has been written.</p>

<p>When moving files using <tt>move</tt> or <tt>preMove</tt> option the files are restricted to the FTP_ROOT folder. That prevents you from moving files outside the FTP area. If you want to move files to another area you can use soft links and move files into a soft linked folder.</p>

<h3><a name="FTP2-MessageHeaders"></a>Message Headers</h3>

<p>The following message headers can be used to affect the behavior of the component</p>

<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Header </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelFileName</tt> </td>
<td class='confluenceTd'> Specifies the output file name (relative to the endpoint directory) to be used for the output message when sending to the endpoint. If this is not present and no expression either, then a generated message ID is used as the filename instead. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelFileNameProduced</tt> </td>
<td class='confluenceTd'> The actual absolute filepath (path + name) for the output file that was written. This header is set by Camel and its purpose is providing end-users the name of the file that was written. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelFileBatchIndex</tt> </td>
<td class='confluenceTd'> Current index out of total number of files being consumed in this batch. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelFileBatchSize</tt> </td>
<td class='confluenceTd'> Total number of files being consumed in this batch. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelFileHost</tt> </td>
<td class='confluenceTd'> The remote hostname. </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelFileLocalWorkPath</tt> </td>
<td class='confluenceTd'> Path to the local work file, if local work directory is used. </td>
</tr>
</tbody></table>
</div>
</div>

<p>In addition the FTP/FTPS consumer and producer will enrich the Camel <tt>Message</tt> with the following headers</p>
<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Header </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelFtpReplyCode</tt> </td>
<td class='confluenceTd'> <b>Camel 2.11.1:</b> The FTP client reply code (the type is a integer) </td>
</tr>
<tr>
<td class='confluenceTd'> <tt>CamelFtpReplyString</tt> </td>
<td class='confluenceTd'> <b>Camel 2.11.1:</b> The FTP client reply string </td>
</tr>
</tbody></table>
</div>
</div>

<h3><a name="FTP2-Abouttimeouts"></a>About timeouts</h3>

<p>The two set of libraries (see top) has different API for setting timeout. You can use the <tt>connectTimeout</tt> option for both of them to set a timeout in millis to establish a network connection. An individual <tt>soTimeout</tt> can also be set on the FTP/FTPS, which corresponds to using <tt>ftpClient.soTimeout</tt>. Notice SFTP will automatically use <tt>connectTimeout</tt> as its <tt>soTimeout</tt>. The <tt>timeout</tt> option only applies for FTP/FTSP as the data timeout, which corresponds to the <tt>ftpClient.dataTimeout</tt> value. All timeout values are in millis.</p>


<h3><a name="FTP2-UsingLocalWorkDirectory"></a>Using Local Work Directory</h3>

<p>Camel supports consuming from remote FTP servers and downloading the files directly into a local work directory. This avoids reading the entire remote file content into memory as it is streamed directly into the local file using <tt>FileOutputStream</tt>.</p>

<p>Camel will store to a local file with the same name as the remote file, though with <tt>.inprogress</tt> as extension while the file is being downloaded. Afterwards, the file is renamed to remove the <tt>.inprogress</tt> suffix. And finally, when the <a href="/confluence/display/CAMEL/Exchange" title="Exchange">Exchange</a> is complete the local file is deleted.</p>

<p>So if you want to download files from a remote FTP server and store it as files then you need to route to a file endpoint such as:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
from("ftp://someone@someserver.com?password=secret&amp;localWorkDirectory=/tmp").to("file://inbox");
</pre>
</div></div>

<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td><b>Optimization by renaming work file</b><br />The route above is ultra efficient as it avoids reading the entire file content into memory. It will download the remote file directly to a local file stream. The <tt>java.io.File</tt> handle is then used as the <a href="/confluence/display/CAMEL/Exchange" title="Exchange">Exchange</a> body. The file producer leverages this fact and can work directly on the work file <tt>java.io.File</tt> handle and perform a <tt>java.io.File.rename</tt> to the target filename. As Camel knows it's a local work file, it can optimize and use a rename instead of a file copy, as the work file is meant to be deleted anyway.</td></tr></table></div>

<h3><a name="FTP2-Stepwisechangingdirectories"></a>Stepwise changing directories</h3>

<p>Camel <a href="/confluence/display/CAMEL/FTP2" title="FTP2">FTP</a> can operate in two modes in terms of traversing directories when consuming files (eg downloading) or producing files (eg uploading)</p>
<ul class="alternate" type="square">
	<li>stepwise</li>
	<li>not stepwise</li>
</ul>


<p>You may want to pick either one depending on your situation and security issues. Some Camel end users can only download files if they use stepwise, while others can only download if they do not. At least you have the choice to pick (from Camel 2.6 onwards).</p>

<p>In Camel 2.0 - 2.5 there is only one mode and it is:</p>
<ul class="alternate" type="square">
	<li>before 2.5 not stepwise</li>
	<li>2.5 stepwise</li>
</ul>


<p>From Camel 2.6 onwards there is now an option <tt>stepwise</tt> you can use to control the behavior.</p>

<p>Note that stepwise changing of directory will in most cases only work when the user is confined to it's home directory and when the home directory is reported as <tt>"/"</tt>.</p>

<p>The difference between the two of them is best illustrated with an example. Suppose we have the following directory structure on the remote FTP server we need to traverse and download files:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
/
/one
/one/two
/one/two/sub-a
/one/two/sub-b
</pre>
</div></div>

<p>And that we have a file in each of sub-a (a.txt) and sub-b (b.txt) folder.</p>

<h4><a name="FTP2-Usingstepwise%3Dtrue%28defaultmode%29"></a>Using stepwise=true (default mode)</h4>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
TYPE A
200 Type set to A
PWD
257 "/" is current directory.
CWD one
250 CWD successful. "/one" is current directory.
CWD two
250 CWD successful. "/one/two" is current directory.
SYST
215 UNIX emulated by FileZilla
PORT 127,0,0,1,17,94
200 Port command successful
LIST
150 Opening data channel for directory list.
226 Transfer OK
CWD sub-a
250 CWD successful. "/one/two/sub-a" is current directory.
PORT 127,0,0,1,17,95
200 Port command successful
LIST
150 Opening data channel for directory list.
226 Transfer OK
CDUP
200 CDUP successful. "/one/two" is current directory.
CWD sub-b
250 CWD successful. "/one/two/sub-b" is current directory.
PORT 127,0,0,1,17,96
200 Port command successful
LIST
150 Opening data channel for directory list.
226 Transfer OK
CDUP
200 CDUP successful. "/one/two" is current directory.
CWD /
250 CWD successful. "/" is current directory.
PWD
257 "/" is current directory.
CWD one
250 CWD successful. "/one" is current directory.
CWD two
250 CWD successful. "/one/two" is current directory.
PORT 127,0,0,1,17,97
200 Port command successful
RETR foo.txt
150 Opening data channel for file transfer.
226 Transfer OK
CWD /
250 CWD successful. "/" is current directory.
PWD
257 "/" is current directory.
CWD one
250 CWD successful. "/one" is current directory.
CWD two
250 CWD successful. "/one/two" is current directory.
CWD sub-a
250 CWD successful. "/one/two/sub-a" is current directory.
PORT 127,0,0,1,17,98
200 Port command successful
RETR a.txt
150 Opening data channel for file transfer.
226 Transfer OK
CWD /
250 CWD successful. "/" is current directory.
PWD
257 "/" is current directory.
CWD one
250 CWD successful. "/one" is current directory.
CWD two
250 CWD successful. "/one/two" is current directory.
CWD sub-b
250 CWD successful. "/one/two/sub-b" is current directory.
PORT 127,0,0,1,17,99
200 Port command successful
RETR b.txt
150 Opening data channel for file transfer.
226 Transfer OK
CWD /
250 CWD successful. "/" is current directory.
QUIT
221 Goodbye
disconnected.
</pre>
</div></div>

<p>As you can see when stepwise is enabled, it will traverse the directory structure using CD xxx.</p>

<h4><a name="FTP2-Usingstepwise%3Dfalse"></a>Using stepwise=false</h4>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
230 Logged on
TYPE A
200 Type set to A
SYST
215 UNIX emulated by FileZilla
PORT 127,0,0,1,4,122
200 Port command successful
LIST one/two
150 Opening data channel for directory list
226 Transfer OK
PORT 127,0,0,1,4,123
200 Port command successful
LIST one/two/sub-a
150 Opening data channel for directory list
226 Transfer OK
PORT 127,0,0,1,4,124
200 Port command successful
LIST one/two/sub-b
150 Opening data channel for directory list
226 Transfer OK
PORT 127,0,0,1,4,125
200 Port command successful
RETR one/two/foo.txt
150 Opening data channel for file transfer.
226 Transfer OK
PORT 127,0,0,1,4,126
200 Port command successful
RETR one/two/sub-a/a.txt
150 Opening data channel for file transfer.
226 Transfer OK
PORT 127,0,0,1,4,127
200 Port command successful
RETR one/two/sub-b/b.txt
150 Opening data channel for file transfer.
226 Transfer OK
QUIT
221 Goodbye
disconnected.
</pre>
</div></div>

<p>As you can see when not using stepwise, there are no CD operation invoked at all.</p>

<h3><a name="FTP2-Samples"></a>Samples</h3>

<p>In the sample below we set up Camel to download all the reports from the FTP server once every hour (60 min) as BINARY content and store it as files on the local file system.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="theme: Default; brush: java; gutter: false"><![CDATA[
protected RouteBuilder createRouteBuilder() throws Exception {
    return new RouteBuilder() {
        public void configure() throws Exception {
            // we use a delay of 60 minutes (eg. once pr. hour we poll the FTP server
            long delay = 60 * 60 * 1000L;

            // from the given FTP server we poll (= download) all the files
            // from the public/reports folder as BINARY types and store this as files
            // in a local directory. Camel will use the filenames from the FTPServer

            // notice that the FTPConsumer properties must be prefixed with "consumer." in the URL
            // the delay parameter is from the FileConsumer component so we should use consumer.delay as
            // the URI parameter name. The FTP Component is an extension of the File Component.
            from("ftp://tiger:scott@localhost/public/reports?binary=true&amp;consumer.delay=" + delay).
                    to("file://target/test-reports");
        }
    };
}
]]></script>
</div></div>

<p>And the route using Spring DSL:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
  &lt;route&gt;
     &lt;from uri="ftp://scott@localhost/public/reports?password=tiger&amp;amp;binary=true&amp;amp;delay=60000"/&gt;
     &lt;to uri="file://target/test-reports"/&gt;
  &lt;/route&gt;
</pre>
</div></div>

<h4><a name="FTP2-ConsumingaremoteFTPSserver%28implicitSSL%29andclientauthentication"></a>Consuming a remote FTPS server (implicit SSL) and client authentication</h4>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
from("ftps://admin@localhost:2222/public/camel?password=admin&amp;securityProtocol=SSL&amp;isImplicit=true
      &amp;ftpClient.keyStore.file=./src/test/resources/server.jks
      &amp;ftpClient.keyStore.password=password&amp;ftpClient.keyStore.keyPassword=password")
  .to("bean:foo");
</pre>
</div></div>

<h4><a name="FTP2-ConsumingaremoteFTPSserver%28explicitTLS%29andacustomtruststoreconfiguration"></a>Consuming a remote FTPS server (explicit TLS) and a custom trust store configuration</h4>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
from("ftps://admin@localhost:2222/public/camel?password=admin&amp;ftpClient.trustStore.file=./src/test/resources/server.jks&amp;ftpClient.trustStore.password=password")
  .to("bean:foo");
</pre>
</div></div>

<h3><a name="FTP2-Filterusing%7B%7Borg.apache.camel.component.file.GenericFileFilter%7D%7D"></a>Filter using <tt>org.apache.camel.component.file.GenericFileFilter</tt></h3>

<p>Camel supports pluggable filtering strategies. This strategy it to use the build in <tt>org.apache.camel.component.file.GenericFileFilter</tt> in Java. You can then configure the endpoint with such a filter to skip certain filters before being processed.</p>

<p>In the sample we have built our own filter that only accepts files starting with report in the filename.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="theme: Default; brush: java; gutter: false"><![CDATA[
public class MyFileFilter&lt;T&gt; implements GenericFileFilter&lt;T&gt; {

    public boolean accept(GenericFile&lt;T&gt; file) {
        // we only want report files 
        return file.getFileName().startsWith("report");
    }
}
]]></script>
</div></div>

<p>And then we can configure our route using the <b>filter</b> attribute to reference our filter (using <tt>&#35;</tt> notation) that we have defined in the spring XML file:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Default; brush: xml; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
   &lt;!-- define our sorter as a plain spring bean --&gt;
   &lt;bean id="myFilter" class="com.mycompany.MyFileFilter"/&gt;

  &lt;route&gt;
    &lt;from uri="ftp://someuser@someftpserver.com?password=secret&amp;amp;filter=#myFilter"/&gt;
    &lt;to uri="bean:processInbox"/&gt;
  &lt;/route&gt;
</pre>
</div></div>


<h3><a name="FTP2-FilteringusingANTpathmatcher"></a>Filtering using ANT path matcher</h3>

<p>The ANT path matcher is a filter that is shipped out-of-the-box in the <b>camel-spring</b> jar. So you need to depend on <b>camel-spring</b> if you are using Maven.<br/>
The reason is that we leverage Spring's <a href="http://static.springsource.org/spring/docs/3.0.x/api/org/springframework/util/AntPathMatcher.html" class="external-link" rel="nofollow">AntPathMatcher</a> to do the actual matching.</p>

<p>The file paths are matched with the following rules:</p>
<ul class="alternate" type="square">
	<li><tt>?</tt> matches one character</li>
	<li><tt>&#42;</tt> matches zero or more characters</li>
	<li><tt>&#42;&#42;</tt> matches zero or more directories in a path</li>
</ul>


<p>The sample below demonstrates how to use it:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<script type="syntaxhighlighter" class="theme: Default; brush: xml; gutter: false"><![CDATA[
&lt;bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/&gt;
&lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
    &lt;template id="camelTemplate"/&gt;

    &lt;!-- use myFilter as filter to allow setting ANT paths for which files to scan for --&gt;
    &lt;endpoint id="myFTPEndpoint" uri="ftp://admin@localhost:${SpringFileAntPathMatcherRemoteFileFilterTest.ftpPort}/antpath?password=admin&amp;amp;recursive=true&amp;amp;delay=10000&amp;amp;initialDelay=2000&amp;amp;filter=#myAntFilter"/&gt;

    &lt;route&gt;
        &lt;from ref="myFTPEndpoint"/&gt;
        &lt;to uri="mock:result"/&gt;
    &lt;/route&gt;
&lt;/camelContext&gt;

&lt;!-- we use the AntPathMatcherRemoteFileFilter to use ant paths for includes and exclude --&gt;
&lt;bean id="myAntFilter" class="org.apache.camel.component.file.AntPathMatcherGenericFileFilter"&gt;
    &lt;!-- include any files in the sub folder that has day in the name --&gt;
    &lt;property name="includes" value="**/subfolder/**/*day*"/&gt;
    &lt;!-- exclude all files with bad in name or .xml files. Use comma to separate multiple excludes --&gt;
    &lt;property name="excludes" value="**/*bad*,**/*.xml"/&gt;
&lt;/bean&gt;
]]></script>
</div></div>

<h3><a name="FTP2-Debuglogging"></a>Debug logging</h3>

<p>This component has log level <b>TRACE</b> that can be helpful if you have problems.</p>

<h3><a name="FTP2-SeeAlso"></a>See Also</h3>
<ul>
	<li><a href="/confluence/display/CAMEL/Configuring+Camel" title="Configuring Camel">Configuring Camel</a></li>
	<li><a href="/confluence/display/CAMEL/Component" title="Component">Component</a></li>
	<li><a href="/confluence/display/CAMEL/Endpoint" title="Endpoint">Endpoint</a></li>
	<li><a href="/confluence/display/CAMEL/Getting+Started" title="Getting Started">Getting Started</a></li>
</ul>

<ul class="alternate" type="square">
	<li><a href="/confluence/display/CAMEL/File2" title="File2">File2</a></li>
</ul>

    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://cwiki.apache.org/confluence/users/removespacenotification.action?spaceKey=CAMEL">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://cwiki.apache.org/confluence/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/FTP2">View Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=109470&revisedVersion=80&originalVersion=79">View Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/FTP2?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message