You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by bu...@apache.org on 2012/08/09 23:20:11 UTC

svn commit: r828517 [3/5] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache file2.html

Modified: websites/production/camel/content/book-in-one-page.html
==============================================================================
--- websites/production/camel/content/book-in-one-page.html (original)
+++ websites/production/camel/content/book-in-one-page.html Thu Aug  9 21:20:11 2012
@@ -24129,23 +24129,21 @@ spring-event:<span class="code-keyword">
 <h3><a shape="rect" name="BookInOnePage-SeeAlso"></a>See Also</h3>
 <ul><li><a shape="rect" href="configuring-camel.html" title="Configuring Camel">Configuring Camel</a></li><li><a shape="rect" href="component.html" title="Component">Component</a></li><li><a shape="rect" href="endpoint.html" title="Endpoint">Endpoint</a></li><li><a shape="rect" href="getting-started.html" title="Getting Started">Getting Started</a></li></ul>
 
-<h2><a shape="rect" name="BookInOnePage-FileComponent"></a>File Component </h2>
+<h2><a shape="rect" name="BookInOnePage-FileComponent"></a>File Component</h2>
 
 <p>The File component provides access to file systems, allowing files to be processed by any other Camel <a shape="rect" href="components.html" title="Components">Components</a> or messages from other components to be saved to disk.</p>
 
 <h3><a shape="rect" name="BookInOnePage-URIformat"></a>URI format</h3>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-file:directoryName[?options]
+<pre class="code-java">file:directoryName[?options]
 </pre>
 </div></div>
 
 <p>or</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-file:<span class="code-comment">//directoryName[?options]</span>
+<pre class="code-java">file:<span class="code-comment">//directoryName[?options]</span>
 </pre>
 </div></div>
 
@@ -24155,8 +24153,7 @@ file:<span class="code-comment">//direct
 
 <div class="panelMacro"><table class="tipMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/check.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Only directories</b><br clear="none">Camel supports only endpoints configured with a starting directory. So the <b>directoryName</b> must be a directory.<br clear="none">
 If you want to consume a single file only, you can use the <b>fileName</b> option, e.g. by setting <tt>fileName=thefilename</tt>.<br clear="none">
-Also, the starting directory must not contain dynamic expressions with ${ } placeholders. Again use the <tt>fileName</tt> option to specify the dynamic part of the filename.</td></tr></table></div>  
-
+Also, the starting directory must not contain dynamic expressions with ${ } placeholders. Again use the <tt>fileName</tt> option to specify the dynamic part of the filename.</td></tr></table></div>
 <div class="panelMacro"><table class="warningMacro"><colgroup span="1"><col span="1" width="24"><col span="1"></colgroup><tr><td colspan="1" rowspan="1" valign="top"><img align="middle" src="https://cwiki.apache.org/confluence/images/icons/emoticons/forbidden.gif" width="16" height="16" alt="" border="0"></td><td colspan="1" rowspan="1"><b>Avoid reading files currently being written by another application</b><br clear="none">Beware the JDK File IO API is a bit limited in detecting whether another application is currently writing/copying a file. And the implementation can be different depending on OS platform as well. This could lead to that Camel thinks the file is not locked by another process and start consuming it. Therefore you have to do you own investigation what suites your environment. To help with this Camel provides different <tt>readLock</tt> options and <tt>doneFileOption</tt> option that you can use. See also the section <em>Consuming files from folders where ot
 hers drop files directly</em>.</td></tr></table></div>
 
 <h3><a shape="rect" name="BookInOnePage-URIOptions"></a>URI Options</h3>
@@ -24169,19 +24166,14 @@ Also, the starting directory must not co
 
 <h4><a shape="rect" name="BookInOnePage-Consumer"></a>Consumer</h4>
 <div class="confluenceTableSmall"><div class="table-wrap">
-<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Name </th><th colspan="1" rowspan="1" class="confluenceTh"> Default Value </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>initialDelay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>1000</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Milliseconds before polling the file/directory starts. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>delay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>500</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Milliseconds before the next poll of the file/directory. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>useFixedDelay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class="confluenceTd"> Controls if fixed delay or fix
 ed rate is used. See <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html" rel="nofollow">ScheduledExecutorService</a> in JDK for details. In <b>Camel 2.7.x</b> or older the default value is <tt>false</tt>. From <b>Camel 2.8</b> onwards the default value is <tt>true</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>runLoggingLevel</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>TRACE</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.8:</b> The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>recursive</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> If a directory, will look for files in all the sub-directories as well.
  </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>delete</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> If <tt>true</tt>, the file will be deleted <b>after</b> it is processed </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>noop</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> If <tt>true</tt>, the file is not moved or deleted in any way. This option is good for readonly data, or for <a shape="rect" href="etl.html" title="ETL">ETL</a> type requirements. If <tt>noop=true</tt>, Camel will set <tt>idempotent=true</tt> as well, to avoid consuming the same files over and over again. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>preMove</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceT
 d"> <a shape="rect" href="expression.html" title="Expression">Expression</a> (such as <a shape="rect" href="file-language.html" title="File Language">File Language</a>) used to dynamically set the filename when moving it <b>before</b> processing. For example to move in-progress files into the <tt>order</tt> directory set this value to <tt>order</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>move</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>.camel</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <a shape="rect" href="expression.html" title="Expression">Expression</a> (such as <a shape="rect" href="file-language.html" title="File Language">File Language</a>) used to dynamically set the filename when moving it <b>after</b> processing. To move files into a <tt>.done</tt> subdirectory just enter <tt>.done</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>moveFailed</tt> </td><td colspan="1" rowspan="
 1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">  <a shape="rect" href="expression.html" title="Expression">Expression</a> (such as <a shape="rect" href="file-language.html" title="File Language">File Language</a>) used to dynamically set a different target directory when moving files after processing (configured via <tt>move</tt> defined above) failed. For example, to move files into a <tt>.error</tt> subdirectory use: <tt>.error</tt>. Note: When moving the files to the &#8220;fail&#8221; location Camel will <b>handle</b> the error and will not pick up the file again. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>include</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Is used to include files, if filename matches the regex pattern. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>exclude</tt> </td><td colspan=
 "1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Is used to exclude files, if filename matches the regex pattern. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>antInclude</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10:</b> Ant style filter inclusion, for example <tt>antInclude=**/*.txt</tt>. Multiple inclusions may be specified in comma-delimited format. See <a shape="rect" href="#BookInOnePage-FilteringusingANTpathmatcher">below</a> for more details about ant path filters. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>antExclude</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10:</b> Ant style filter exclusion. If both <tt>antInclude</tt> and <tt>antExclude</tt> are used, <tt>antExclude</t
 t> takes precedence over <tt>antInclude</tt>. Multiple exclusions may be specified in comma-delimited format. See <a shape="rect" href="#BookInOnePage-FilteringusingANTpathmatcher">below</a> for more details about ant path filters. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>idempotent</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Option to use the <a shape="rect" href="idempotent-consumer.html" title="Idempotent Consumer">Idempotent Consumer</a> EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entries. If <tt>noop=true</tt> then idempotent will be enabled as well to avoid consuming the same files over and over again. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>idempotentRepository</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowsp
 an="1" class="confluenceTd"> A pluggable repository <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/IdempotentRepository.html">org.apache.camel.spi.IdempotentRepository</a> which by default use <tt>MemoryMessageIdRepository</tt> if none is specified and <tt>idempotent</tt> is <tt>true</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>inProgressRepository</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>memory</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> A pluggable in-progress repository <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/IdempotentRepository.html">org.apache.camel.spi.IdempotentRepository</a>. The in-progress repository is used to account the current in progress files being consumed. By default a memory based repository is used. </td></tr><tr><td colspan="1" rows
 pan="1" class="confluenceTd"> <tt>filter</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Pluggable filter as a <tt>org.apache.camel.component.file.GenericFileFilter</tt> class. Will skip files if filter returns <tt>false</tt> in its <tt>accept()</tt> method. More details in section below. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>sorter</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Pluggable sorter as a <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Comparator.html" rel="nofollow">java.util.Comparator&lt;org.apache.camel.component.file.GenericFile&gt;</a> class. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>sortBy</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" c
 lass="confluenceTd"> Built-in sort using the <a shape="rect" href="file-language.html" title="File Language">File Language</a>. Supports nested sorts, so you can have a sort by file name and as a 2nd group sort by modified date. See sorting section below for details. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>readLock</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>markerFile</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Used by consumer, to only poll the files if it has exclusive read-lock on the file (i.e. the file is not in-progress or being written). Camel will wait until the file lock is granted. <br clear="none">
-This option provides the build in strategies: 
-<br clear="none" class="atl-forced-newline"> <tt>markerFile</tt> Camel creates a marker file and then holds a lock on it. This option is <b>not</b> available for the <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> component.
-<br clear="none" class="atl-forced-newline"> <tt>changed</tt> is using file length/modification timestamp to detect whether the file is currently being copied or not. Will at least use 1 sec. to determine this, so this option cannot consume files as fast as the others, but can be more reliable as the JDK IO API cannot always determine whether a file is currently being used by another process. This option is <b>only</b> avail for the <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> component from <b>Camel 2.8</b> onwards. 
-<br clear="none" class="atl-forced-newline"> <tt>fileLock</tt> is for using <tt>java.nio.channels.FileLock</tt>. This option is <b>not</b> avail for the <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks.
-<br clear="none" class="atl-forced-newline"> <tt>rename</tt> is for using a try to rename the file as a test if we can get exclusive read-lock.
-<br clear="none" class="atl-forced-newline"> <tt>none</tt> is for no read locks at all.<br clear="none">
-Notice from <b>Camel 2.10</b> onwards the read locks <tt>changed</tt>, <tt>fileLock</tt> and <tt>rename</tt> will also use a <tt>markerFile</tt> as well, to ensure not picking up files that may be in process by another Camel consumer running on another node (eg cluster). This is only supported by the file component (not the ftp component). </td></tr><tr><td></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>readLockTimeout</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"><ul class="alternate" type="square"><li></li></ul>
-</td><td colspan="1" rowspan="1" class="confluenceTd"> Optional timeout in millis for the read-lock, if supported by the read-lock. If the read-lock could not be granted and the timeout triggered, then Camel will skip the file. At next poll Camel, will try the file again, and this time maybe the read-lock could be granted. Use a value of 0 or lower to indicate forever. In <b>Camel 2.0</b> the default value is 0. In <b>Camel 2.1</b> the default value is 10000. Currently <tt>fileLock</tt>, <tt>changed</tt> and <tt>rename</tt> support the timeout. For <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> the default <tt>readLockTimeout</tt> value is 20000. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>readLockCheckInterval</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>1000</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.6:</b> Interval in millis for the read-lock, if supported by the read lock. This interval is used
  for sleeping between attempts to acquire the read lock. For example when using the <tt>changed</tt> read lock, you can set a higher interval period to cater for <em>slow writes</em>. The default of 1 sec. may be <em>too fast</em> if the producer is very slow writing the file. For <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> the default <tt>readLockCheckInterval</tt> is <tt>5000</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>directoryMustExist</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.5:</b> Similar to <tt>startingDirectoryMustExist</tt> but this applies during polling recursive sub directories. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>doneFileName</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.6:</b> If provided, Camel will
  only consume files if a <em>done</em> file exists. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders. The <em>done</em> file is <b>always</b> expected in the same folder as the original file. See <em>using done file</em> and <em>writing done file</em> sections for examples. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>exclusiveReadLockStrategy</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Pluggable read-lock as a <tt>org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy</tt> implementation. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>maxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>0</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> An integer to define a maximum messages to gather per poll. By default no maximum is set.
  Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. Set a value of 0 or negative to disabled it. See more details at <a shape="rect" href="batch-consumer.html" title="Batch Consumer">Batch Consumer</a>. <b>Notice:</b> If this option is in use then the <a shape="rect" href="file2.html" title="File2">File</a> and <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> components will limit <b>before</b> any sorting. For example if you have 100000 files and use <tt>maxMessagesPerPoll=500</tt>, then only the first 500 files will be picked up, and then sorted. You can use the <tt>eagerMaxMessagesPerPoll</tt> option and set this to <tt>false</tt> to allow to scan all files first and then sort afterwards. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>eagerMaxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <
 b>Camel 2.9.3:</b> Allows for controlling whether the limit from <tt>maxMessagesPerPoll</tt> is eager or not. If eager then the limit is during the scanning of files. Where as <tt>false</tt> would scan all files, and then perform sorting. Setting this option to <tt>false</tt> allows for sorting all files first, and then limit the poll. Mind that this requires a higher memory usage as all file details are in memory to perform the sorting. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>minDepth</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> 0 </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.8</b>: The minimum depth to start processing when recursively processing a directory. Using <tt>minDepth=1</tt> means the base directory. Using <tt>minDepth=2</tt> means the first sub directory. This option is supported by <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> consumer from <b>Camel 2.8.2, 2.9</b> onwards. </td></tr><tr><td 
 colspan="1" rowspan="1" class="confluenceTd"> <tt>maxDepth</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>Integer.MAX_VALUE</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.8:</b> The maximum depth to traverse when recursively processing a directory. This option is supported by <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> consumer from <b>Camel 2.8.2, 2.9</b> onwards. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>processStrategy</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> A pluggable <tt>org.apache.camel.component.file.GenericFileProcessStrategy</tt> allowing you to implement your own <tt>readLock</tt> option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special <em>ready</em> file exists. If this option is set then the <tt>readLock</tt> option does not apply. </t
 d></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>startingDirectoryMustExist</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.5:</b> Whether the starting directory must exist. Mind that the <tt>autoCreate</tt> option is default enabled, which means the starting directory is normally auto created if it doesn't exist. You can disable <tt>autoCreate</tt> and enable this to ensure the starting directory must exist. Will thrown an exception if the directory doesn't exist. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>pollStrategy</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.0:</b> A pluggable <tt>org.apache.camel.PollingConsumerPollStrategy</tt> allowing you to provide your custom implementation to control error handling usually occurred during the <tt>poll</t
 t> operation <b>before</b> an <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> have been created and being routed in Camel. In other words the error occurred while the polling was gathering information, for instance access to a file network failed so Camel cannot access it to scan for files. The default implementation will log the caused exception at <tt>WARN</tt> level and ignore it. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>sendEmptyMessageWhenIdle</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.9:</b> If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.bridgeErrorHandler</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd
 "> <b>Camel 2.10:</b> Allows for bridging the consumer to the Camel routing <a shape="rect" href="error-handler.html" title="Error Handler">Error Handler</a>, which mean any exceptions occurred while trying to pickup files, or the likes, will now be processed as a message and handled by the routing <a shape="rect" href="error-handler.html" title="Error Handler">Error Handler</a>. By default the consumer will use the <tt>org.apache.camel.spi.ExceptionHandler</tt> to deal with exceptions, that by default will be logged at WARN/ERROR level and ignored. See further below on this page fore more details, at section <em>How to use the Camel error handler to deal with exceptions triggered outside the routing engine</em>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>scheduledExecutorService</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10:</b> Allows for configuring a 
 custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool. This option allows you to share a thread pool among multiple file consumers. </td></tr></tbody></table>
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Name </th><th colspan="1" rowspan="1" class="confluenceTh"> Default Value </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>initialDelay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>1000</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Milliseconds before polling the file/directory starts. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>delay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>500</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Milliseconds before the next poll of the file/directory. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>useFixedDelay</tt> </td><td colspan="1" rowspan="1" class="confluenceTd">&#160;</td><td colspan="1" rowspan="1" class="confluenceTd"> Controls if fixed delay or fix
 ed rate is used. See <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/ScheduledExecutorService.html" rel="nofollow">ScheduledExecutorService</a> in JDK for details. In <b>Camel 2.7.x</b> or older the default value is <tt>false</tt>. From <b>Camel 2.8</b> onwards the default value is <tt>true</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>runLoggingLevel</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>TRACE</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.8:</b> The consumer logs a start/complete log line when it polls. This option allows you to configure the logging level for that. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>recursive</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> If a directory, will look for files in all the sub-directories as well.
  </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>delete</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> If <tt>true</tt>, the file will be deleted <b>after</b> it is processed </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>noop</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> If <tt>true</tt>, the file is not moved or deleted in any way. This option is good for readonly data, or for <a shape="rect" href="etl.html" title="ETL">ETL</a> type requirements. If <tt>noop=true</tt>, Camel will set <tt>idempotent=true</tt> as well, to avoid consuming the same files over and over again. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>preMove</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceT
 d"> <a shape="rect" href="expression.html" title="Expression">Expression</a> (such as <a shape="rect" href="file-language.html" title="File Language">File Language</a>) used to dynamically set the filename when moving it <b>before</b> processing. For example to move in-progress files into the <tt>order</tt> directory set this value to <tt>order</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>move</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>.camel</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <a shape="rect" href="expression.html" title="Expression">Expression</a> (such as <a shape="rect" href="file-language.html" title="File Language">File Language</a>) used to dynamically set the filename when moving it <b>after</b> processing. To move files into a <tt>.done</tt> subdirectory just enter <tt>.done</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>moveFailed</tt> </td><td colspan="1" rowspan="
 1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <a shape="rect" href="expression.html" title="Expression">Expression</a> (such as <a shape="rect" href="file-language.html" title="File Language">File Language</a>) used to dynamically set a different target directory when moving files after processing (configured via <tt>move</tt> defined above) failed. For example, to move files into a <tt>.error</tt> subdirectory use: <tt>.error</tt>. Note: When moving the files to the &#8220;fail&#8221; location Camel will <b>handle</b> the error and will not pick up the file again. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>include</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Is used to include files, if filename matches the regex pattern. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>exclude</tt> </td><td colspan="
 1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Is used to exclude files, if filename matches the regex pattern. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>antInclude</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10:</b> Ant style filter inclusion, for example <tt>antInclude=*</tt><tt><b>/</b></tt><tt>.txt</tt>. Multiple inclusions may be specified in comma-delimited format. See <a shape="rect" href="#BookInOnePage-FilteringusingANTpathmatcher">below</a> for more details about ant path filters. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>antExclude</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10:</b> Ant style filter exclusion. If both <tt>antInclude</tt> and <tt>antExclude</tt> are u
 sed, <tt>antExclude</tt> takes precedence over <tt>antInclude</tt>. Multiple exclusions may be specified in comma-delimited format. See <a shape="rect" href="#BookInOnePage-FilteringusingANTpathmatcher">below</a> for more details about ant path filters. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>idempotent</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Option to use the <a shape="rect" href="idempotent-consumer.html" title="Idempotent Consumer">Idempotent Consumer</a> EIP pattern to let Camel skip already processed files. Will by default use a memory based LRUCache that holds 1000 entries. If <tt>noop=true</tt> then idempotent will be enabled as well to avoid consuming the same files over and over again. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>idempotentRepository</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td
 ><td colspan="1" rowspan="1" class="confluenceTd"> A pluggable repository <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/IdempotentRepository.html">org.apache.camel.spi.IdempotentRepository</a> which by default use <tt>MemoryMessageIdRepository</tt> if none is specified and <tt>idempotent</tt> is <tt>true</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>inProgressRepository</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>memory</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> A pluggable in-progress repository <a shape="rect" class="external-link" href="http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/IdempotentRepository.html">org.apache.camel.spi.IdempotentRepository</a>. The in-progress repository is used to account the current in progress files being consumed. By default a memory based repository is used. </td></tr><t
 r><td colspan="1" rowspan="1" class="confluenceTd"> <tt>filter</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Pluggable filter as a <tt>org.apache.camel.component.file.GenericFileFilter</tt> class. Will skip files if filter returns <tt>false</tt> in its <tt>accept()</tt> method. More details in section below. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>sorter</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Pluggable sorter as a <a shape="rect" class="external-link" href="http://java.sun.com/j2se/1.5.0/docs/api/java/util/Comparator.html" rel="nofollow">java.util.Comparator&lt;org.apache.camel.component.file.GenericFile&gt;</a> class. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>sortBy</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td col
 span="1" rowspan="1" class="confluenceTd"> Built-in sort using the <a shape="rect" href="file-language.html" title="File Language">File Language</a>. Supports nested sorts, so you can have a sort by file name and as a 2nd group sort by modified date. See sorting section below for details. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>readLock</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>markerFile</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Used by consumer, to only poll the files if it has exclusive read-lock on the file (i.e. the file is not in-progress or being written). Camel will wait until the file lock is granted. <br clear="none" class="atl-forced-newline">
+This option provides the build in strategies: <br clear="none" class="atl-forced-newline">  <tt>markerFile</tt> Camel creates a marker file and then holds a lock on it. This option is <b>not</b> available for the <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> component. <br clear="none" class="atl-forced-newline">  <tt>changed</tt> is using file length/modification timestamp to detect whether the file is currently being copied or not. Will at least use 1 sec. to determine this, so this option cannot consume files as fast as the others, but can be more reliable as the JDK IO API cannot always determine whether a file is currently being used by another process. This option is <b>only</b> avail for the <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> component from <b>Camel 2.8</b> onwards. <br clear="none" class="atl-forced-newline">  <tt>fileLock</tt> is for using <tt>java.nio.channels.FileLock</tt>. This option is <b>not</b> avail for the <a shape="rect" href="ft
 p2.html" title="FTP2">FTP</a> component. This approach should be avoided when accessing a remote file system via a mount/share unless that file system supports distributed file locks. <br clear="none" class="atl-forced-newline">  <tt>rename</tt> is for using a try to rename the file as a test if we can get exclusive read-lock. <br clear="none" class="atl-forced-newline">  <tt>none</tt> is for no read locks at all. <br clear="none" class="atl-forced-newline">
+Notice from <b>Camel 2.10</b> onwards the read locks <tt>changed</tt>, <tt>fileLock</tt> and <tt>rename</tt> will also use a <tt>markerFile</tt> as well, to ensure not picking up files that may be in process by another Camel consumer running on another node (eg cluster). This is only supported by the file component (not the ftp component). </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>readLockTimeout</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> 20000 </td><td colspan="1" rowspan="1" class="confluenceTd"> Optional timeout in millis for the read-lock, if supported by the read-lock. If the read-lock could not be granted and the timeout triggered, then Camel will skip the file. At next poll Camel, will try the file again, and this time maybe the read-lock could be granted. Use a value of 0 or lower to indicate forever. In <b>Camel 2.0</b> the default value is 0. In <b>Camel 2.1</b> the default value is 10000. Currently <tt>fileLock</tt>, <tt>
 changed</tt> and <tt>rename</tt> support the timeout. For <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> the default <tt>readLockTimeout</tt> value is 20000. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>readLockCheckInterval</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>1000</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.6:</b> Interval in millis for the read-lock, if supported by the read lock. This interval is used for sleeping between attempts to acquire the read lock. For example when using the <tt>changed</tt> read lock, you can set a higher interval period to cater for <em>slow writes</em>. The default of 1 sec. may be <em>too fast</em> if the producer is very slow writing the file. For <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> the default <tt>readLockCheckInterval</tt> is <tt>5000</tt>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>directoryMustExist</tt> </td><td
  colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.5:</b> Similar to <tt>startingDirectoryMustExist</tt> but this applies during polling recursive sub directories. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>doneFileName</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.6:</b> If provided, Camel will only consume files if a <em>done</em> file exists. This option configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders. The <em>done</em> file is <b>always</b> expected in the same folder as the original file. See <em>using done file</em> and <em>writing done file</em> sections for examples. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>exclusiveReadLockStrategy</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"
 > <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Pluggable read-lock as a <tt>org.apache.camel.component.file.GenericFileExclusiveReadLockStrategy</tt> implementation. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>maxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>0</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> An integer to define a maximum messages to gather per poll. By default no maximum is set. Can be used to set a limit of e.g. 1000 to avoid when starting up the server that there are thousands of files. Set a value of 0 or negative to disabled it. See more details at <a shape="rect" href="batch-consumer.html" title="Batch Consumer">Batch Consumer</a>. <b>Notice:</b> If this option is in use then the <a shape="rect" href="file2.html" title="File2">File</a> and <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> components will limit <b>before</b> any sorting. For example if you h
 ave 100000 files and use <tt>maxMessagesPerPoll=500</tt>, then only the first 500 files will be picked up, and then sorted. You can use the <tt>eagerMaxMessagesPerPoll</tt> option and set this to <tt>false</tt> to allow to scan all files first and then sort afterwards. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>eagerMaxMessagesPerPoll</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.9.3:</b> Allows for controlling whether the limit from <tt>maxMessagesPerPoll</tt> is eager or not. If eager then the limit is during the scanning of files. Where as <tt>false</tt> would scan all files, and then perform sorting. Setting this option to <tt>false</tt> allows for sorting all files first, and then limit the poll. Mind that this requires a higher memory usage as all file details are in memory to perform the sorting. </td></tr><tr><td colspan="1" rowspan="1" class="conflu
 enceTd"> <tt>minDepth</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> 0 </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.8</b>: The minimum depth to start processing when recursively processing a directory. Using <tt>minDepth=1</tt> means the base directory. Using <tt>minDepth=2</tt> means the first sub directory. This option is supported by <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> consumer from <b>Camel 2.8.2, 2.9</b> onwards. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>maxDepth</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>Integer.MAX_VALUE</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.8:</b> The maximum depth to traverse when recursively processing a directory. This option is supported by <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> consumer from <b>Camel 2.8.2, 2.9</b> onwards. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>processStr
 ategy</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> A pluggable <tt>org.apache.camel.component.file.GenericFileProcessStrategy</tt> allowing you to implement your own <tt>readLock</tt> option or similar. Can also be used when special conditions must be met before a file can be consumed, such as a special <em>ready</em> file exists. If this option is set then the <tt>readLock</tt> option does not apply. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>startingDirectoryMustExist</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.5:</b> Whether the starting directory must exist. Mind that the <tt>autoCreate</tt> option is default enabled, which means the starting directory is normally auto created if it doesn't exist. You can disable <tt>autoCreate</tt> and enable this to ensure the starti
 ng directory must exist. Will thrown an exception if the directory doesn't exist. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>pollStrategy</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.0:</b> A pluggable <tt>org.apache.camel.PollingConsumerPollStrategy</tt> allowing you to provide your custom implementation to control error handling usually occurred during the <tt>poll</tt> operation <b>before</b> an <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> have been created and being routed in Camel. In other words the error occurred while the polling was gathering information, for instance access to a file network failed so Camel cannot access it to scan for files. The default implementation will log the caused exception at <tt>WARN</tt> level and ignore it. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>sendEmptyMessageWhenIdl
 e</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.9:</b> If the polling consumer did not poll any files, you can enable this option to send an empty message (no body) instead. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>consumer.bridgeErrorHandler</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10:</b> Allows for bridging the consumer to the Camel routing <a shape="rect" href="error-handler.html" title="Error Handler">Error Handler</a>, which mean any exceptions occurred while trying to pickup files, or the likes, will now be processed as a message and handled by the routing <a shape="rect" href="error-handler.html" title="Error Handler">Error Handler</a>. By default the consumer will use the <tt>org.apache.camel.spi.ExceptionHandler</tt> to deal with exceptions, that 
 by default will be logged at WARN/ERROR level and ignored. See further below on this page fore more details, at section <em>How to use the Camel error handler to deal with exceptions triggered outside the routing engine</em>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>scheduledExecutorService</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10:</b> Allows for configuring a custom/shared thread pool to use for the consumer. By default each consumer has its own single threaded thread pool. This option allows you to share a thread pool among multiple file consumers. </td></tr></tbody></table>
 </div>
 </div>
 
 <h4><a shape="rect" name="BookInOnePage-Defaultbehaviorforfileconsumer"></a>Default behavior for file consumer</h4>
+
 <ul><li>By default the file is locked for the duration of the processing.</li><li>After the route has completed, files are moved into the <tt>.camel</tt> subdirectory, so that they appear to be deleted.</li><li>The File Consumer will always skip any file whose name starts with a dot, such as <tt>.</tt>, <tt>.camel</tt>, <tt>.m2</tt> or <tt>.groovy</tt>.</li><li>Only files (not directories) are matched for valid filename, if options such as: <tt>include</tt> or <tt>exclude</tt> are used.</li></ul>
 
 
@@ -24193,59 +24185,58 @@ Notice from <b>Camel 2.10</b> onwards th
 
 
 <h4><a shape="rect" name="BookInOnePage-Defaultbehaviorforfileproducer"></a>Default behavior for file producer</h4>
+
 <ul><li>By default it will override any existing file, if one exist with the same name.</li></ul>
 
 
 <h3><a shape="rect" name="BookInOnePage-MoveandDeleteoperations"></a>Move and Delete operations</h3>
-<p>Any move or delete operations is executed after (post command) the routing has completed; so during processing of the <tt>Exchange</tt> the file is still located in the inbox folder. </p>
+
+<p>Any move or delete operations is executed after (post command) the routing has completed; so during processing of the <tt>Exchange</tt> the file is still located in the inbox folder.</p>
 
 <p>Lets illustrate this with an example:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-    from(<span class="code-quote">"file:<span class="code-comment">//inbox?move=.done"</span>).to(<span class="code-quote">"bean:handleOrder"</span>);</span>
+<pre class="code-java">    from(<span class="code-quote">"file:<span class="code-comment">//inbox?move=.done"</span>).to(<span class="code-quote">"bean:handleOrder"</span>);</span>
 </pre>
 </div></div>
 <p>When a file is dropped in the <tt>inbox</tt> folder, the file consumer notices this and creates a new <tt>FileExchange</tt> that is routed to the <tt>handleOrder</tt> bean. The bean then processes the <tt>File</tt> object. At this point in time the file is still located in the <tt>inbox</tt> folder. After the bean completes, and thus the route is completed, the file consumer will perform the move operation and move the file to the <tt>.done</tt> sub-folder.</p>
 
-<p>The <b>move</b> and <b>preMove</b> options should be a directory name, which can be either relative or absolute. If relative, the directory is created as a sub-folder from within the folder where the file was consumed. </p>
+<p>The <b>move</b> and <b>preMove</b> options should be a directory name, which can be either relative or absolute. If relative, the directory is created as a sub-folder from within the folder where the file was consumed.</p>
 
 <p>By default, Camel will move consumed files to the <tt>.camel</tt> sub-folder relative to the directory where the file was consumed.</p>
 
 <p>If you want to delete the file after processing, the route should be:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-    from(<span class="code-quote">"file:<span class="code-comment">//inobox?delete=<span class="code-keyword">true</span>"</span>).to(<span class="code-quote">"bean:handleOrder"</span>);</span>
+<pre class="code-java">    from(<span class="code-quote">"file:<span class="code-comment">//inobox?delete=<span class="code-keyword">true</span>"</span>).to(<span class="code-quote">"bean:handleOrder"</span>);</span>
 </pre>
 </div></div>
 
 <p>We have introduced a <b>pre</b> move operation to move files <b>before</b> they are processed. This allows you to mark which files have been scanned as they are moved to this sub folder before being processed.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-    from(<span class="code-quote">"file:<span class="code-comment">//inbox?preMove=inprogress"</span>).to(<span class="code-quote">"bean:handleOrder"</span>);</span>
+<pre class="code-java">    from(<span class="code-quote">"file:<span class="code-comment">//inbox?preMove=inprogress"</span>).to(<span class="code-quote">"bean:handleOrder"</span>);</span>
 </pre>
 </div></div>
 
 <p>You can combine the <b>pre</b> move and the regular move:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-    from(<span class="code-quote">"file:<span class="code-comment">//inbox?preMove=inprogress&amp;move=.done"</span>).to(<span class="code-quote">"bean:handleOrder"</span>);</span>
+<pre class="code-java">    from(<span class="code-quote">"file:<span class="code-comment">//inbox?preMove=inprogress&amp;move=.done"</span>).to(<span class="code-quote">"bean:handleOrder"</span>);</span>
 </pre>
 </div></div>
 <p>So in this situation, the file is in the <tt>inprogress</tt> folder when being processed and after it's processed, it's moved to the <tt>.done</tt> folder.</p>
 
 <h4><a shape="rect" name="BookInOnePage-FinegrainedcontroloverMoveandPreMoveoption"></a>Fine grained control over Move and PreMove option</h4>
+
 <p>The <b>move</b> and <b>preMove</b> option is <a shape="rect" href="expression.html" title="Expression">Expression</a>-based, so we have the full power of the <a shape="rect" href="file-language.html" title="File Language">File Language</a> to do advanced configuration of the directory and name pattern.<br clear="none">
-Camel will, in fact, internally convert the directory name you enter into a <a shape="rect" href="file-language.html" title="File Language">File Language</a> expression. So when we enter <tt>move=.done</tt> Camel will convert this into: <tt>${<a shape="rect" class="external-link" href="file:parent" rel="nofollow">file:parent</a>}/.done/${<a shape="rect" class="external-link" href="file:onlyname" rel="nofollow">file:onlyname</a></tt>}. This is only done if Camel detects that you have not provided a ${ } in the option value yourself. So when you enter a ${ } Camel will <b>not</b> convert it and thus you have the full power.</p>
+Camel will, in fact, internally convert the directory name you enter into a <a shape="rect" href="file-language.html" title="File Language">File Language</a> expression. So when we enter <tt>move=.done</tt> Camel will convert this into: <tt>${</tt><tt><a shape="rect" class="external-link" href="file:parent" rel="nofollow">file:parent</a></tt><tt>}/.done/${</tt><tt><a shape="rect" class="external-link" href="file:onlyname" rel="nofollow">file:onlyname</a></tt>}. This is only done if Camel detects that you have not provided a ${ } in the option value yourself. So when you enter a ${ } Camel will <b>not</b> convert it and thus you have the full power.</p>
 
 <p>So if we want to move the file into a backup folder with today's date as the pattern, we can do:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-move=backup/${date:now:yyyyMMdd}/${file:name}
+<pre class="code-java">move=backup/${date:now:yyyyMMdd}/${file:name}
 </pre>
-</div></div> 
+</div></div>
 
 <h4><a shape="rect" name="BookInOnePage-AboutmoveFailed"></a>About moveFailed</h4>
-<p>The <tt>moveFailed</tt> option allows you to move files that <b>could not</b> be processed succesfully to another location such as a error folder of your choice. For example to move the files in an error folder with a timestamp you can use <tt>moveFailed=/error/${<a shape="rect" class="external-link" href="file:name.noext" rel="nofollow">file:name.noext</a>}-${date:now:yyyyMMddHHmmssSSS}.${<a shape="rect" class="external-link" href="file:ext" rel="nofollow">file:ext</a></tt>}.</p>
+
+<p>The <tt>moveFailed</tt> option allows you to move files that <b>could not</b> be processed succesfully to another location such as a error folder of your choice. For example to move the files in an error folder with a timestamp you can use <tt>moveFailed=/error/${</tt><tt><a shape="rect" class="external-link" href="file:name.noext" rel="nofollow">file:name.noext</a></tt><tt>}-${date:now:yyyyMMddHHmmssSSS}.${</tt><tt><a shape="rect" class="external-link" href="file:ext" rel="nofollow">file:ext</a></tt>}.</p>
 
 <p>See more examples at <a shape="rect" href="file-language.html" title="File Language">File Language</a></p>
 
@@ -24256,7 +24247,7 @@ move=backup/${date:now:yyyyMMdd}/${file:
 
 <h4><a shape="rect" name="BookInOnePage-Fileproduceronly"></a>File producer only</h4>
 <div class="confluenceTableSmall"><div class="table-wrap">
-<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Header </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>CamelFileName</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Specifies the name of the file to write (relative to the endpoint directory). The name can be a <tt>String</tt>; a <tt>String</tt> with a <a shape="rect" href="file-language.html" title="File Language">File Language</a> or <a shape="rect" href="simple.html" title="Simple">Simple</a> expression; or an <a shape="rect" href="expression.html" title="Expression">Expression</a> object. If it's <tt>null</tt> then Camel will auto-generate a filename based on the message unique ID.  </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>CamelFileNameProduced</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> The actual absolute filepath (path + name) for the o
 utput file that was written. This header is set by Camel and its purpose is providing end-users with the name of the file that was written. </td></tr></tbody></table>
+<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Header </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>CamelFileName</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> Specifies the name of the file to write (relative to the endpoint directory). The name can be a <tt>String</tt>; a <tt>String</tt> with a <a shape="rect" href="file-language.html" title="File Language">File Language</a> or <a shape="rect" href="simple.html" title="Simple">Simple</a> expression; or an <a shape="rect" href="expression.html" title="Expression">Expression</a> object. If it's <tt>null</tt> then Camel will auto-generate a filename based on the message unique ID. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>CamelFileNameProduced</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> The actual absolute filepath (path + name) for the ou
 tput file that was written. This header is set by Camel and its purpose is providing end-users with the name of the file that was written. </td></tr></tbody></table>
 </div>
 </div>
 
@@ -24267,9 +24258,11 @@ move=backup/${date:now:yyyyMMdd}/${file:
 </div>
 
 <h3><a shape="rect" name="BookInOnePage-BatchConsumer"></a>Batch Consumer</h3>
-<p>This component implements the <a shape="rect" href="batch-consumer.html" title="Batch Consumer">Batch Consumer</a>. </p>
+
+<p>This component implements the <a shape="rect" href="batch-consumer.html" title="Batch Consumer">Batch Consumer</a>.</p>
 
 <h4><a shape="rect" name="BookInOnePage-ExchangeProperties%2Cfileconsumeronly"></a>Exchange Properties, file consumer only</h4>
+
 <p>As the file consumer is <tt>BatchConsumer</tt> it supports batching the files it polls. By batching it means that Camel will add some properties to the <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> so you know the number of files polled the current index in that order.</p>
 <div class="confluenceTableSmall"><div class="table-wrap">
 <table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"> Property </th><th colspan="1" rowspan="1" class="confluenceTh"> Description </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>CamelBatchSize</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> The total number of files that was polled in this batch. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>CamelBatchIndex</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> The current index of the batch. Starts from 0. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>CamelBatchComplete</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> A <tt>boolean</tt> value indicating the last <a shape="rect" href="exchange.html" title="Exchange">Exchange</a> in the batch. Is only <tt>true</tt> for the last entry. </td></tr></tbody></table>
@@ -24279,20 +24272,19 @@ move=backup/${date:now:yyyyMMdd}/${file:
 <p>This allows you for instance to know how many files exists in this batch and for instance let the <a shape="rect" href="aggregator2.html" title="Aggregator2">Aggregator2</a> aggregate this number of files.</p>
 
 <h3><a shape="rect" name="BookInOnePage-Usingcharset"></a>Using charset</h3>
-<p><b>Available as of Camel 2.9.3</b> <br clear="none">
+
+<p><b>Available as of Camel 2.9.3</b><br clear="none">
 The charset option allows for configuring an encoding of the files on both the consumer and producer endpoints. For example if you read utf-8 files, and want to convert the files to iso-8859-1, you can do:</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:inbox?charset=utf-8"</span>)
+<pre class="code-java">from(<span class="code-quote">"file:inbox?charset=utf-8"</span>)
   .to(<span class="code-quote">"file:outbox?charset=iso-8859-1"</span>)
 </pre>
 </div></div>
 
 <p>You can also use the <tt>convertBodyTo</tt> in the route. In the example below we have still input files in utf-8 format, but we want to convert the file content to a byte array in iso-8859-1 format. And then let a bean process the data. Before writing the content to the outbox folder using the current charset.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:inbox?charset=utf-8"</span>)
+<pre class="code-java">from(<span class="code-quote">"file:inbox?charset=utf-8"</span>)
   .convertBodyTo(<span class="code-object">byte</span>[].class, <span class="code-quote">"iso-8859-1"</span>)
   .to(<span class="code-quote">"bean:myBean"</span>)
   .to(<span class="code-quote">"file:outbox"</span>);
@@ -24304,8 +24296,7 @@ from(<span class="code-quote">"file:inbo
 <p>In the example below this could be a problem if the files is not in UTF-8 encoding, which would be the default encoding for read the files.<br clear="none">
 In this example when writing the files, the content has already been converted to a byte array, and thus would write the content directly as is (without any further encodings).</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:inbox"</span>)
+<pre class="code-java">from(<span class="code-quote">"file:inbox"</span>)
   .convertBodyTo(<span class="code-object">byte</span>[].class, <span class="code-quote">"iso-8859-1"</span>)
   .to(<span class="code-quote">"bean:myBean"</span>)
   .to(<span class="code-quote">"file:outbox"</span>);
@@ -24314,8 +24305,7 @@ from(<span class="code-quote">"file:inbo
 
 <p>You can also override and control the encoding dynamic when writing files, by setting a property on the exchange with the key <tt>Exchange.CHARSET_NAME</tt>. For example in the route below we set the property with a value from a message header.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:inbox"</span>)
+<pre class="code-java">from(<span class="code-quote">"file:inbox"</span>)
   .convertBodyTo(<span class="code-object">byte</span>[].class, <span class="code-quote">"iso-8859-1"</span>)
   .to(<span class="code-quote">"bean:myBean"</span>)
   .setProperty(Exchange.CHARSET_NAME, header(<span class="code-quote">"someCharsetHeader"</span>))
@@ -24330,64 +24320,60 @@ from(<span class="code-quote">"file:inbo
 <p>If you have some issues then you can enable DEBUG logging on <tt>org.apache.camel.component.file</tt>, and Camel logs when it reads/write a file using a specific charset.<br clear="none">
 For example the route below will log the following:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:inbox?charset=utf-8"</span>)
+<pre class="code-java">from(<span class="code-quote">"file:inbox?charset=utf-8"</span>)
   .to(<span class="code-quote">"file:outbox?charset=iso-8859-1"</span>)
 </pre>
 </div></div>
 <p>And the logs:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-DEBUG GenericFileConverter           - Read file /Users/davsclaus/workspace/camel/camel-core/target/charset/input/input.txt with charset utf-8
+<pre class="code-java">DEBUG GenericFileConverter           - Read file /Users/davsclaus/workspace/camel/camel-core/target/charset/input/input.txt with charset utf-8
 DEBUG FileOperations                 - Using Reader to write file: target/charset/output.txt with charset: iso-8859-1
 </pre>
 </div></div>
 
 <h3><a shape="rect" name="BookInOnePage-Commongotchaswithfolderandfilenames"></a>Common gotchas with folder and filenames</h3>
 
-<p>When Camel is producing files (writing files) there are a few gotchas affecting how to set a filename of your choice. By default, Camel will use the message ID as the filename, and since the message ID is normally a unique generated ID, you will end up with filenames such as: <tt>ID-MACHINENAME-2443-1211718892437-1-0</tt>. If such a filename is not desired, then you must provide a filename in the <tt>CamelFileName</tt> message header. The constant, <tt>Exchange.FILE_NAME</tt>, can also be used. </p>
+<p>When Camel is producing files (writing files) there are a few gotchas affecting how to set a filename of your choice. By default, Camel will use the message ID as the filename, and since the message ID is normally a unique generated ID, you will end up with filenames such as: <tt>ID-MACHINENAME-2443-1211718892437-1-0</tt>. If such a filename is not desired, then you must provide a filename in the <tt>CamelFileName</tt> message header. The constant, <tt>Exchange.FILE_NAME</tt>, can also be used.</p>
 
 <p>The sample code below produces files using the message ID as the filename:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"direct:report"</span>).to(<span class="code-quote">"file:target/reports"</span>);
+<pre class="code-java">from(<span class="code-quote">"direct:report"</span>).to(<span class="code-quote">"file:target/reports"</span>);
 </pre>
 </div></div>
 <p>To use <tt>report.txt</tt> as the filename you have to do:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"direct:report"</span>).setHeader(Exchange.FILE_NAME, constant(<span class="code-quote">"report.txt"</span>)).to( <span class="code-quote">"file:target/reports"</span>);
+<pre class="code-java">from(<span class="code-quote">"direct:report"</span>).setHeader(Exchange.FILE_NAME, constant(<span class="code-quote">"report.txt"</span>)).to( <span class="code-quote">"file:target/reports"</span>);
 </pre>
 </div></div>
 <p>... the same as above, but with <tt>CamelFileName</tt>:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"direct:report"</span>).setHeader(<span class="code-quote">"CamelFileName"</span>, constant(<span class="code-quote">"report.txt"</span>)).to( <span class="code-quote">"file:target/reports"</span>);
+<pre class="code-java">from(<span class="code-quote">"direct:report"</span>).setHeader(<span class="code-quote">"CamelFileName"</span>, constant(<span class="code-quote">"report.txt"</span>)).to( <span class="code-quote">"file:target/reports"</span>);
 </pre>
 </div></div>
 <p>And a syntax where we set the filename on the endpoint with the <b>fileName</b> URI option.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"direct:report"</span>).to(<span class="code-quote">"file:target/reports/?fileName=report.txt"</span>);
+<pre class="code-java">from(<span class="code-quote">"direct:report"</span>).to(<span class="code-quote">"file:target/reports/?fileName=report.txt"</span>);
 </pre>
 </div></div>
 
 <h3><a shape="rect" name="BookInOnePage-FilenameExpression"></a>Filename Expression</h3>
+
 <p>Filename can be set either using the <b>expression</b> option or as a string-based <a shape="rect" href="file-language.html" title="File Language">File Language</a> expression in the <tt>CamelFileName</tt> header. See the <a shape="rect" href="file-language.html" title="File Language">File Language</a> for syntax and samples.</p>
 
 <h3><a shape="rect" name="BookInOnePage-Consumingfilesfromfolderswhereothersdropfilesdirectly"></a>Consuming files from folders where others drop files directly</h3>
+
 <p>Beware if you consume files from a folder where other applications write files directly. Take a look at the different <tt>readLock</tt> options to see what suits your use cases. The best approach is however to write to another folder and after the write move the file in the drop folder. However if you write files directly to the drop folder then the option <tt>changed</tt> could better detect whether a file is currently being written/copied as it uses a file changed algorithm to see whether the file size / modification changes over a period of time. The other read lock options rely on Java File API that sadly is not always very good at detecting this. You may also want to look at the <tt>doneFileName</tt> option, which uses a marker file (done) to signal when a file is done and ready to be consumed.</p>
 
 
 <h3><a shape="rect" name="BookInOnePage-Usingdonefiles"></a>Using done files</h3>
+
 <p><b>Available as of Camel 2.6</b></p>
 
 <p>See also section <em>writing done files</em> below.</p>
 
-<p>If you want only to consume files when a done file exists, then you can use the <tt>doneFileName</tt> option on the endpoint. </p>
+<p>If you want only to consume files when a done file exists, then you can use the <tt>doneFileName</tt> option on the endpoint.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:bar?doneFileName=done"</span>);
+<pre class="code-java">from(<span class="code-quote">"file:bar?doneFileName=done"</span>);
 </pre>
 </div></div>
 <p>Will only consume files from the bar folder, if a file name done exists in the same directory as the target files. Camel will automatically delete the done file when it's done consuming the files. From Camel <b>2.9.3</b> onwards Camel will not automatic delete the done file if <tt>noop=true</tt> is configured.</p>
@@ -24395,8 +24381,7 @@ from(<span class="code-quote">"file:bar?
 <p>However its more common to have one done file per target file. This means there is a 1:1 correlation. To do this you must use dynamic placeholders in the <tt>doneFileName</tt> option. Currently Camel supports the following two dynamic tokens: <tt><a shape="rect" class="external-link" href="file:name" rel="nofollow">file:name</a></tt> and <tt><a shape="rect" class="external-link" href="file:name.noext" rel="nofollow">file:name.noext</a></tt> which must be enclosed in ${ }. The consumer only supports the static part of the done file name as either prefix or suffix (not both).</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:bar?doneFileName=${file:name}.done"</span>);
+<pre class="code-java">from(<span class="code-quote">"file:bar?doneFileName=${file:name}.done"</span>);
 </pre>
 </div></div>
 
@@ -24406,8 +24391,7 @@ from(<span class="code-quote">"file:bar?
 
 <p>You can also use a prefix for the done file, such as:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:bar?doneFileName=ready-${file:name}"</span>);
+<pre class="code-java">from(<span class="code-quote">"file:bar?doneFileName=ready-${file:name}"</span>);
 </pre>
 </div></div>
 <ul class="alternate" type="square"><li><tt>hello.txt</tt> - is the file to be consumed</li><li><tt>ready-hello.txt</tt> - is the associated done file</li></ul>
@@ -24416,35 +24400,32 @@ from(<span class="code-quote">"file:bar?
 
 
 <h3><a shape="rect" name="BookInOnePage-Writingdonefiles"></a>Writing done files</h3>
+
 <p><b>Available as of Camel 2.6</b></p>
 
-<p>After you have written af file you may want to write an additional <em>done</em> file as a kinda of marker, to indicate to others that the file is finished and has been written. To do that you can use the <tt>doneFileName</tt> option on the file producer endpoint. </p>
+<p>After you have written af file you may want to write an additional <em>done</em> file as a kinda of marker, to indicate to others that the file is finished and has been written. To do that you can use the <tt>doneFileName</tt> option on the file producer endpoint.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-.to(<span class="code-quote">"file:bar?doneFileName=done"</span>);
+<pre class="code-java">.to(<span class="code-quote">"file:bar?doneFileName=done"</span>);
 </pre>
 </div></div>
 <p>Will simply create a file named <tt>done</tt> in the same directory as the target file.</p>
 
-<p>However its more common to have one done file per target file. This means there is a 1:1 correlation. To do this you must use dynamic placeholders in the <tt>doneFileName</tt> option. Currently Camel supports the following two dynamic tokens: <tt><a shape="rect" class="external-link" href="file:name" rel="nofollow">file:name</a></tt> and <tt><a shape="rect" class="external-link" href="file:name.noext" rel="nofollow">file:name.noext</a></tt> which must be enclosed in ${ }. </p>
+<p>However its more common to have one done file per target file. This means there is a 1:1 correlation. To do this you must use dynamic placeholders in the <tt>doneFileName</tt> option. Currently Camel supports the following two dynamic tokens: <tt><a shape="rect" class="external-link" href="file:name" rel="nofollow">file:name</a></tt> and <tt><a shape="rect" class="external-link" href="file:name.noext" rel="nofollow">file:name.noext</a></tt> which must be enclosed in ${ }.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-.to(<span class="code-quote">"file:bar?doneFileName=done-${file:name}"</span>);
+<pre class="code-java">.to(<span class="code-quote">"file:bar?doneFileName=done-${file:name}"</span>);
 </pre>
 </div></div>
 <p>Will for example create a file named <tt>done-foo.txt</tt> if the target file was <tt>foo.txt</tt> in the same directory as the target file.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-.to(<span class="code-quote">"file:bar?doneFileName=${file:name}.done"</span>);
+<pre class="code-java">.to(<span class="code-quote">"file:bar?doneFileName=${file:name}.done"</span>);
 </pre>
 </div></div>
 <p>Will for example create a file named <tt>foo.txt.done</tt> if the target file was <tt>foo.txt</tt> in the same directory as the target file.</p>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-.to(<span class="code-quote">"file:bar?doneFileName=${file:name.noext}.done"</span>);
+<pre class="code-java">.to(<span class="code-quote">"file:bar?doneFileName=${file:name.noext}.done"</span>);
 </pre>
 </div></div>
 <p>Will for example create a file named <tt>foo.done</tt> if the target file was <tt>foo.txt</tt> in the same directory as the target file.</p>
@@ -24454,8 +24435,7 @@ from(<span class="code-quote">"file:bar?
 <h4><a shape="rect" name="BookInOnePage-Readfromadirectoryandwritetoanotherdirectory"></a>Read from a directory and write to another directory</h4>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:<span class="code-comment">//inputdir/?delete=<span class="code-keyword">true</span>"</span>).to(<span class="code-quote">"file://outputdir"</span>)</span>
+<pre class="code-java">from(<span class="code-quote">"file:<span class="code-comment">//inputdir/?delete=<span class="code-keyword">true</span>"</span>).to(<span class="code-quote">"file://outputdir"</span>)</span>
 </pre>
 </div></div>
 
@@ -24463,72 +24443,65 @@ from(<span class="code-quote">"file:<spa
 
 <h4><a shape="rect" name="BookInOnePage-Readingrecursivelyfromadirectoryandwritingtoanother"></a>Reading recursively from a directory and writing to another</h4>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:<span class="code-comment">//inputdir/?recursive=<span class="code-keyword">true</span>&amp;delete=<span class="code-keyword">true</span>"</span>).to(<span class="code-quote">"file://outputdir"</span>)</span>
+<pre class="code-java">from(<span class="code-quote">"file:<span class="code-comment">//inputdir/?recursive=<span class="code-keyword">true</span>&amp;delete=<span class="code-keyword">true</span>"</span>).to(<span class="code-quote">"file://outputdir"</span>)</span>
 </pre>
 </div></div>
 
 <p>Listen on a directory and create a message for each file dropped there. Copy the contents to the <tt>outputdir</tt> and delete the file in the <tt>inputdir</tt>. Will scan recursively into sub-directories. Will lay out the files in the same directory structure in the <tt>outputdir</tt> as the <tt>inputdir</tt>, including any sub-directories.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-inputdir/foo.txt
+<pre class="code-java">inputdir/foo.txt
 inputdir/sub/bar.txt
 </pre>
 </div></div>
 <p>Will result in the following output layout:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-outputdir/foo.txt
+<pre class="code-java">outputdir/foo.txt
 outputdir/sub/bar.txt
 </pre>
 </div></div>
 
 <h5><a shape="rect" name="BookInOnePage-Usingflatten"></a>Using flatten</h5>
+
 <p>If you want to store the files in the outputdir directory in the same directory, disregarding the source directory layout (e.g. to flatten out the path), you just add the <tt>flatten=true</tt> option on the file producer side:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:<span class="code-comment">//inputdir/?recursive=<span class="code-keyword">true</span>&amp;delete=<span class="code-keyword">true</span>"</span>).to(<span class="code-quote">"file://outputdir?flatten=<span class="code-keyword">true</span>"</span>)</span>
+<pre class="code-java">from(<span class="code-quote">"file:<span class="code-comment">//inputdir/?recursive=<span class="code-keyword">true</span>&amp;delete=<span class="code-keyword">true</span>"</span>).to(<span class="code-quote">"file://outputdir?flatten=<span class="code-keyword">true</span>"</span>)</span>
 </pre>
 </div></div>
 <p>Will result in the following output layout:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-outputdir/foo.txt
+<pre class="code-java">outputdir/foo.txt
 outputdir/bar.txt
 </pre>
 </div></div>
 
 <h4><a shape="rect" name="BookInOnePage-Readingfromadirectoryandthedefaultmoveoperation"></a>Reading from a directory and the default move operation</h4>
-<p>Camel will by default move any processed file into a <tt>.camel</tt> subdirectory in the directory the file was consumed from. </p>
+
+<p>Camel will by default move any processed file into a <tt>.camel</tt> subdirectory in the directory the file was consumed from.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:<span class="code-comment">//inputdir/?recursive=<span class="code-keyword">true</span>&amp;delete=<span class="code-keyword">true</span>"</span>).to(<span class="code-quote">"file://outputdir"</span>)</span>
+<pre class="code-java">from(<span class="code-quote">"file:<span class="code-comment">//inputdir/?recursive=<span class="code-keyword">true</span>&amp;delete=<span class="code-keyword">true</span>"</span>).to(<span class="code-quote">"file://outputdir"</span>)</span>
 </pre>
 </div></div>
 <p>Affects the layout as follows:<br clear="none">
 <b>before</b></p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-inputdir/foo.txt
+<pre class="code-java">inputdir/foo.txt
 inputdir/sub/bar.txt
 </pre>
 </div></div>
 
 <p><b>after</b></p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-inputdir/.camel/foo.txt
+<pre class="code-java">inputdir/.camel/foo.txt
 inputdir/sub/.camel/bar.txt
 outputdir/foo.txt
 outputdir/sub/bar.txt
 </pre>
 </div></div>
 
-<h4><a shape="rect" name="BookInOnePage-Readfromadirectoryandprocessthemessageinjava"></a>Read from a directory and process the message in java </h4>
+<h4><a shape="rect" name="BookInOnePage-Readfromadirectoryandprocessthemessageinjava"></a>Read from a directory and process the message in java</h4>
 
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:<span class="code-comment">//inputdir/"</span>).process(<span class="code-keyword">new</span> Processor() {
+<pre class="code-java">from(<span class="code-quote">"file:<span class="code-comment">//inputdir/"</span>).process(<span class="code-keyword">new</span> Processor() {
 </span>  <span class="code-keyword">public</span> void process(Exchange exchange) <span class="code-keyword">throws</span> Exception {
     <span class="code-object">Object</span> body = exchange.getIn().getBody();
     <span class="code-comment">// <span class="code-keyword">do</span> some business logic with the input body
@@ -24540,6 +24513,7 @@ from(<span class="code-quote">"file:<spa
 <p>The body will be a <tt>File</tt> object that points to the file that was just dropped into the <tt>inputdir</tt> directory.</p>
 
 <h4><a shape="rect" name="BookInOnePage-Writingtofiles"></a>Writing to files</h4>
+
 <p>Camel is of course also able to write files, i.e. produce files. In the sample below we receive some reports on the SEDA queue that we process before they are written to a directory.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
 <pre class="code-java"><span class="code-keyword">public</span> void testToFile() <span class="code-keyword">throws</span> Exception {
@@ -24588,21 +24562,20 @@ from(<span class="code-quote">"file:<spa
 </div></div>
 
 <h4><a shape="rect" name="BookInOnePage-Writetosubdirectoryusing%7B%7BExchange.FILENAME%7D%7D"></a>Write to subdirectory using <tt>Exchange.FILE_NAME</tt></h4>
+
 <p>Using a single route, it is possible to write a file to any number of subdirectories. If you have a route setup as such:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-  &lt;route&gt;
+<pre class="code-java">  &lt;route&gt;
     &lt;from uri=<span class="code-quote">"bean:myBean"</span>/&gt;
     &lt;to uri=<span class="code-quote">"file:/rootDirectory"</span>/&gt;
-  &lt;/route&gt; 
+  &lt;/route&gt;
 </pre>
 </div></div>
 
 <p>You can have <tt>myBean</tt> set the header <tt>Exchange.FILE_NAME</tt> to values such as:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-Exchange.FILE_NAME = hello.txt =&gt; /rootDirectory/hello.txt
-Exchange.FILE_NAME = foo/bye.txt =&gt; /rootDirectory/foo/bye.txt 
+<pre class="code-java">Exchange.FILE_NAME = hello.txt =&gt; /rootDirectory/hello.txt
+Exchange.FILE_NAME = foo/bye.txt =&gt; /rootDirectory/foo/bye.txt
 </pre>
 </div></div>
 
@@ -24612,25 +24585,23 @@ Exchange.FILE_NAME = foo/bye.txt =&gt; /
 
 <p>In this sample we want to move consumed files to a backup folder using today's date as a sub-folder name:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:<span class="code-comment">//inbox?move=backup/${date:now:yyyyMMdd}/${file:name}"</span>).to(<span class="code-quote">"..."</span>);</span>
+<pre class="code-java">from(<span class="code-quote">"file:<span class="code-comment">//inbox?move=backup/${date:now:yyyyMMdd}/${file:name}"</span>).to(<span class="code-quote">"..."</span>);</span>
 </pre>
 </div></div>
 
 <p>See <a shape="rect" href="file-language.html" title="File Language">File Language</a> for more samples.</p>
 
 <h3><a shape="rect" name="BookInOnePage-Avoidingreadingthesamefilemorethanonce%28idempotentconsumer%29"></a>Avoiding reading the same file more than once (idempotent consumer)</h3>
+
 <p>Camel supports <a shape="rect" href="idempotent-consumer.html" title="Idempotent Consumer">Idempotent Consumer</a> directly within the component so it will skip already processed files. This feature can be enabled by setting the <tt>idempotent=true</tt> option.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-from(<span class="code-quote">"file:<span class="code-comment">//inbox?idempotent=<span class="code-keyword">true</span>"</span>).to(<span class="code-quote">"..."</span>);</span>
+<pre class="code-java">from(<span class="code-quote">"file:<span class="code-comment">//inbox?idempotent=<span class="code-keyword">true</span>"</span>).to(<span class="code-quote">"..."</span>);</span>
 </pre>
 </div></div>
 
 <p>By default Camel uses a in memory based store for keeping track of consumed files, it uses a least recently used cache holding up to 1000 entries. You can plugin your own implementation of this store by using the <tt>idempotentRepository</tt> option using the <tt>#</tt> sign in the value to indicate it's a referring to a bean in the <a shape="rect" href="registry.html" title="Registry">Registry</a> with the specified <tt>id</tt>.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-   <span class="code-tag"><span class="code-comment">&lt;!-- define our store as a plain spring bean --&gt;</span></span>
+<pre class="code-xml">   <span class="code-tag"><span class="code-comment">&lt;!-- define our store as a plain spring bean --&gt;</span></span>
    <span class="code-tag">&lt;bean id=<span class="code-quote">"myStore"</span> class=<span class="code-quote">"com.mycompany.MyIdempotentStore"</span>/&gt;</span>
 
   <span class="code-tag">&lt;route&gt;</span>
@@ -24642,14 +24613,14 @@ from(<span class="code-quote">"file:<spa
 
 <p>Camel will log at <tt>DEBUG</tt> level if it skips a file because it has been consumed before:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">
-DEBUG FileConsumer is idempotent and the file has been consumed before. Will skip <span class="code-keyword">this</span> file: target\idempotent\report.txt
+<pre class="code-java">DEBUG FileConsumer is idempotent and the file has been consumed before. Will skip <span class="code-keyword">this</span> file: target\idempotent\report.txt
 </pre>
 </div></div>
 
 
 <h4><a shape="rect" name="BookInOnePage-Usingafilebasedidempotentrepository"></a>Using a file based idempotent repository</h4>
-<p>In this section we will use the file based idempotent repository <tt>org.apache.camel.processor.idempotent.FileIdempotentRepository</tt> instead of the in-memory based that is used as default. <br clear="none">
+
+<p>In this section we will use the file based idempotent repository <tt>org.apache.camel.processor.idempotent.FileIdempotentRepository</tt> instead of the in-memory based that is used as default.<br clear="none">
 This repository uses a 1st level cache to avoid reading the file repository. It will only use the file repository to store the content of the 1st level cache. Thereby the repository can survive server restarts. It will load the content of the file into the 1st level cache upon startup. The file structure is very simple as it stores the key in separate lines in the file. By default, the file store has a size limit of 1mb. When the file grows larger Camel will truncate the file store, rebuilding the content by flushing the 1st level cache into a fresh empty file.</p>
 
 <p>We configure our repository using Spring XML creating our file idempotent repository and define our file consumer to use our repository with the <tt>idempotentRepository</tt> using <tt>#</tt> sign to indicate <a shape="rect" href="registry.html" title="Registry">Registry</a> lookup:</p>
@@ -24676,7 +24647,8 @@ This repository uses a 1st level cache t
 
 
 <h4><a shape="rect" name="BookInOnePage-UsingaJPAbasedidempotentrepository"></a>Using a JPA based idempotent repository</h4>
-<p>In this section we will use the JPA based idempotent repository instead of the in-memory based that is used as default. </p>
+
+<p>In this section we will use the JPA based idempotent repository instead of the in-memory based that is used as default.</p>
 
 <p>First we need a persistence-unit in <tt>META-INF/persistence.xml</tt> where we need to use the class <tt>org.apache.camel.processor.idempotent.jpa.MessageProcessed</tt> as model.</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
@@ -24722,8 +24694,7 @@ This repository uses a 1st level cache t
 
 <p>And yes then we just need to refer to the <b>jpaStore</b> bean in the file consumer endpoint using the <tt>idempotentRepository</tt> using the <tt>#</tt> syntax option:</p>
 <div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-xml">
-  <span class="code-tag">&lt;route&gt;</span>
+<pre class="code-xml">  <span class="code-tag">&lt;route&gt;</span>
     <span class="code-tag">&lt;from uri=<span class="code-quote">"file://inbox?idempotent=true&amp;amp;idempotentRepository=#jpaStore"</span>/&gt;</span>
     <span class="code-tag">&lt;to uri=<span class="code-quote">"bean:processInbox"</span>/&gt;</span>
   <span class="code-tag">&lt;/route&gt;</span>
@@ -24731,6 +24702,7 @@ This repository uses a 1st level cache t
 </div></div>
 
 <h3><a shape="rect" name="BookInOnePage-Filterusingorg.apache.camel.component.file.GenericFileFilter"></a>Filter using org.apache.camel.component.file.GenericFileFilter</h3>
+
 <p>Camel supports pluggable filtering strategies. You can then configure the endpoint with such a filter to skip certain files being processed.</p>
 
 <p>In the sample we have built our own filter that skips files starting with <tt>skip</tt> in the filename:</p>
@@ -24750,8 +24722,7 @@ This repository uses a 1st level cache t
 

[... 143 lines stripped ...]