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 2013/06/24 12:18:49 UTC

svn commit: r867188 [2/3] - in /websites/production/camel/content: book-component-appendix.html book-in-one-page.html cache/main.pageCache file2.html how-do-i-set-the-max-chars-when-debug-logging-messages-in-camel.html

Modified: websites/production/camel/content/file2.html
==============================================================================
--- websites/production/camel/content/file2.html (original)
+++ websites/production/camel/content/file2.html Mon Jun 24 10:18:49 2013
@@ -35,6 +35,8 @@
     </style>
     <![endif]-->
 
+
+
     <title>
     Apache Camel: File2
     </title>
@@ -52,8 +54,8 @@
     <div class="content_r">
       <div>
           <!-- Banner -->
-<div id="banner-content">
-	<div id="asf_logo">
+<div id="banner-content"><p>
+	</p><div id="asf_logo">
 	<div id="activemq_logo" style="height:108px; background:transparent url(banner.data/apache-camel-7.png) no-repeat scroll left top;">
             <a shape="rect" style="float:left; width:310px;display:block;text-indent:-5000px;text-decoration:none;line-height:140px; margin-top:20px; margin-left:18px;" href="http://camel.apache.org/">Camel</a>
             <a shape="rect" style="float:right; width:180px;display:block;text-indent:-5000px;text-decoration:none;line-height:80px; margin-top:45px; margin-right:10px;" href="http://www.apache.org">Apache</a>
@@ -81,19 +83,13 @@
 
 <h3><a shape="rect" name="File2-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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p><a shape="rect" href="file:directoryName&lt;span class=" error="error">[?options]" class="external-link" rel="nofollow"&gt;file:directoryName<span class="error">[?options]</span></a></p></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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p><a shape="rect" href="file://directoryName&lt;span class=" error="error">[?options]" class="external-link" rel="nofollow"&gt;file://directoryName<span class="error">[?options]</span></a></p></div>
 
 <p>Where <b>directoryName</b> represents the underlying file directory.</p>
 
@@ -115,9 +111,10 @@ Also, the starting directory must not co
 <h4><a shape="rect" name="File2-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=*</tt><tt><b>/</b></tt><tt>.txt</tt>. Multiple inclusions may be specified in comma-delimited format. See <a shape="rect" href="#File2-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</tt> takes precedence over <tt>antInclude</tt>. Multiple exclusions may be specified in comma-delimited format. See <a shape="rect" href="#File2-FilteringusingANTpathmatcher">below</a> for more details about ant path filters. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>antFilterCaseSensitive</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> Ant style filter which is case sensitive or not. </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>idempotentKey</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>Expression</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.11:</b> To use a custom idempotent key. By default the absolute path of the file is used. You can use the <a shape="rect" href="file-language.html" title="File Language">File Language</a>, for example to use the file name and file size, you can do: 
-<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">idempotentKey=${file:name}-${file:size}</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> idempotentKey=$
+<div class="error"><span class="error">Unknown macro: {file}</span> </div>
+<p>-$</p>
+<div class="error"><span class="error">Unknown macro: {file}</span> </div></div>
 <p>. </p></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><tr><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 colspan="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. The option <tt>readLockCheckInterval</tt> can be used to set the check frequency. 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. Notice that from <b>Camel 2.10.1</b> onwards the <a shape="rect" href="ftp2.html" title="FTP2">F
 TP</a> option <tt>fastExistsCheck</tt> can be enabled to speedup this readLock strategy, if the FTP server support the LIST operation with a full file name (some servers may not). <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" 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"> <tt>10000</tt> </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. Starting with <b>Camel 2.1</b> the default value is 10000. Currently <tt
 >fileLock</tt>, <tt>changed</tt> and <tt>rename</tt> support the timeout. <b>Notice:</b> For <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> the default <tt>readLockTimeout</tt> value is <tt>20000</tt> instead of <tt>10000</tt>. </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>readLockMinLength</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>1</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10.1:</b> This option applied only for <tt>readLock=changed</tt>. This option allows you to configure a minimum file length. By default Camel expects the file to contain data, and thus the default value is 1. You can set this option to zero, to allow consuming zero-length files. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>readLockLoggingLevel</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>WARN</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.12:</b> Logging level used when a read lock could not be acquired. By default a WARN is logged. You can change this level, for example to OFF to not have any logging. This option is only applicable for readLock of types: changed, fileLock, rename. </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>exclusiveReadLockStrate
 gy</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> componen
 ts 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 sor
 ting. </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. </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 dis
 able <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"> 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>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.Exception
 Handler</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>
@@ -131,7 +128,7 @@ Notice from <b>Camel 2.10</b> onwards th
 
 <h4><a shape="rect" name="File2-Producer"></a>Producer</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>fileExist</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>Override</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> What to do if a file already exists with the same name. The following values can be specified: <b>Override</b>, <b>Append</b>, <b>Fail</b>, <b>Ignore</b>, and <tt><b>Move</b></tt>. <tt>Override</tt>, which is the default, replaces the existing file. <tt>Append</tt> adds content to the existing file. <tt>Fail</tt> throws a <tt>GenericFileOperationException</tt>, indicating that there is already an existing file. <tt>Ignore</tt> silently ignores the problem and <b>does not</b> override the existing file, but assumes everything is okay. The <
 tt>Move</tt> option requires <b>Camel 2.10.1</b> onwards, and the corresponding <tt>moveExisting</tt> option to be configured as well. The option <tt>eagerDeleteTargetFile</tt> can be used to control what to do if an moving the file, and there exists already an existing file, otherwise causing the move operation to fail. The <tt>Move</tt> option will move any existing files, before writing the target file. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>tempPrefix</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> This option is used to write the file using a temporary name and then, after the write is complete, rename it to the real name. Can be used to identify files being written and also avoid consumers (not using exclusive read locks) reading in progress files. Is often used by <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> when uploading big files. </td></tr><tr><td
  colspan="1" rowspan="1" class="confluenceTd"> <tt>tempFileName</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.1:</b> The <b>same</b> as <tt>tempPrefix</tt> option but offering a more fine grained control on the naming of the temporary filename as it uses the <a shape="rect" href="file-language.html" title="File Language">File Language</a>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>moveExisting</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10.1:</b> <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 compute file name to use when <tt>fileExist=Move</tt> is configured. To move files into a <tt>backup</tt> subdirectory just enter <tt>backup</tt>. Th
 is option only supports the following <a shape="rect" href="file-language.html" title="File Language">File Language</a> tokens: "file:name", "file:name.ext", "file:name.noext", "file:onlyname", "file:onlyname.noext", "file:ext", and "file:parent". Notice the "file:parent" is not supported by the <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> component, as the FTP component can only move any existing files to a relative directory based on current dir as base. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>keepLastModified</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.2:</b> Will keep the last modified timestamp from the source file (if any). Will use the <tt>Exchange.FILE_LAST_MODIFIED</tt> header to located the timestamp. This header can contain either a <tt>java.util.Date</tt> or <tt>long</tt> with the timestamp. If the timestamp exists and the option i
 s enabled it will set this timestamp on the written file. <b>Note:</b> This option only applies to the <b>file</b> producer. You <em>cannot</em> use this option with any of the ftp producers. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>eagerDeleteTargetFile</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.3:</b> Whether or not to eagerly delete any existing target file. This option only applies when you use <tt>fileExists=Override</tt> and the <tt>tempFileName</tt> option as well. You can use this to disable (set it to false) deleting the target file before the temp file is written. For example you may write big files and want the target file to exists during the temp file is being written. This ensure the target file is only deleted until the very last moment, just before the temp file is being renamed to the target filename. From <b>Camel 2.10.1</b> onwards th
 is option is also used to control whether to delete any existing files when <tt>fileExist=Move</tt> is enabled, and an existing file exists. If this option is false, then an exception will be thrown if an existing file existed, if its true, then the existing file is deleted before the move operation. </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, then Camel will write a 2nd <em>done</em> file when the original file has been written. The <em>done</em> file will be empty. 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 will <b>always</b> be written in the same folder as the original file. See <em>writing done file</em> section for examples. </td></tr><tr><td colspan="1" rowspan="1" class="conf
 luenceTd"> <tt>allowNullBody</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10.1:</b> Used to specify if a null body is allowed during file writing. If set to true then an empty file will be created, when set to false, and attempting to send a null body to the file component, a GenericFileWriteException of 'Cannot write null body to file.' will be thrown. If the `fileExist` option is set to 'Override', then the file will be truncated, and if set to `append` the file will remain unchanged. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>forceWrites</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10.5/2.11:</b> Whether to force syncing writes to the file system. You can turn this off if you do not want this level of guarantee, for example if writing to logs / audit logs etc;
  this would yield better performance. </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>fileExist</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>Override</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> What to do if a file already exists with the same name. The following values can be specified: <b>Override</b>, <b>Append</b>, <b>Fail</b>, <b>Ignore</b>, <b>Move</b>, and <b>TryRename</b> (Camel 2.11.1). <tt>Override</tt>, which is the default, replaces the existing file. <tt>Append</tt> adds content to the existing file. <tt>Fail</tt> throws a <tt>GenericFileOperationException</tt>, indicating that there is already an existing file. <tt>Ignore</tt> silently ignores the problem and <b>does not</b> override the existing file, but assumes e
 verything is okay. The <tt>Move</tt> option requires <b>Camel 2.10.1</b> onwards, and the corresponding <tt>moveExisting</tt> option to be configured as well. The option <tt>eagerDeleteTargetFile</tt> can be used to control what to do if an moving the file, and there exists already an existing file, otherwise causing the move operation to fail. The <tt>Move</tt> option will move any existing files, before writing the target file. <tt>TryRename</tt> <b>Camel 2.11.1</b> is only applicable if <tt>tempFileName</tt> option is in use. This allows to try renaming the file from the temporary name to the actual name, without doing any exists check. This check may be faster on some file systems and especially FTP servers. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>tempPrefix</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> This option is used to write the file using a temporary nam
 e and then, after the write is complete, rename it to the real name. Can be used to identify files being written and also avoid consumers (not using exclusive read locks) reading in progress files. Is often used by <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> when uploading big files. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>tempFileName</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.1:</b> The <b>same</b> as <tt>tempPrefix</tt> option but offering a more fine grained control on the naming of the temporary filename as it uses the <a shape="rect" href="file-language.html" title="File Language">File Language</a>. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>moveExisting</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>null</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10.1:</b> <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 compute file name to use when <tt>fileExist=Move</tt> is configured. To move files into a <tt>backup</tt> subdirectory just enter <tt>backup</tt>. This option only supports the following <a shape="rect" href="file-language.html" title="File Language">File Language</a> tokens: "file:name", "file:name.ext", "file:name.noext", "file:onlyname", "file:onlyname.noext", "file:ext", and "file:parent". Notice the "file:parent" is not supported by the <a shape="rect" href="ftp2.html" title="FTP2">FTP</a> component, as the FTP component can only move any existing files to a relative directory based on current dir as base. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>keepLastModified</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="conflue
 nceTd"> <b>Camel 2.2:</b> Will keep the last modified timestamp from the source file (if any). Will use the <tt>Exchange.FILE_LAST_MODIFIED</tt> header to located the timestamp. This header can contain either a <tt>java.util.Date</tt> or <tt>long</tt> with the timestamp. If the timestamp exists and the option is enabled it will set this timestamp on the written file. <b>Note:</b> This option only applies to the <b>file</b> producer. You <em>cannot</em> use this option with any of the ftp producers. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>eagerDeleteTargetFile</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.3:</b> Whether or not to eagerly delete any existing target file. This option only applies when you use <tt>fileExists=Override</tt> and the <tt>tempFileName</tt> option as well. You can use this to disable (set it to false) deleting the target file befor
 e the temp file is written. For example you may write big files and want the target file to exists during the temp file is being written. This ensure the target file is only deleted until the very last moment, just before the temp file is being renamed to the target filename. From <b>Camel 2.10.1</b> onwards this option is also used to control whether to delete any existing files when <tt>fileExist=Move</tt> is enabled, and an existing file exists. If this option is false, then an exception will be thrown if an existing file existed, if its true, then the existing file is deleted before the move operation. </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, then Camel will write a 2nd <em>done</em> file when the original file has been written. The <em>done</em> file will be empty. This opt
 ion configures what file name to use. Either you can specify a fixed name. Or you can use dynamic placeholders. The <em>done</em> file will <b>always</b> be written in the same folder as the original file. See <em>writing done file</em> section for examples. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>allowNullBody</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <tt>false</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10.1:</b> Used to specify if a null body is allowed during file writing. If set to true then an empty file will be created, when set to false, and attempting to send a null body to the file component, a GenericFileWriteException of 'Cannot write null body to file.' will be thrown. If the `fileExist` option is set to 'Override', then the file will be truncated, and if set to `append` the file will remain unchanged. </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"> <tt>forceWrites</tt> </td
 ><td colspan="1" rowspan="1" class="confluenceTd"> <tt>true</tt> </td><td colspan="1" rowspan="1" class="confluenceTd"> <b>Camel 2.10.5/2.11:</b> Whether to force syncing writes to the file system. You can turn this off if you do not want this level of guarantee, for example if writing to logs / audit logs etc; this would yield better performance. </td></tr></tbody></table>
 </div>
 </div>
 
@@ -146,41 +143,28 @@ Notice from <b>Camel 2.10</b> onwards th
 <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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>    from("file://inbox?move=.done").to("bean:handleOrder");</p></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 is considered as a directory name (though if you use an expression such as <a shape="rect" href="file-language.html" title="File Language">File Language</a>, or <a shape="rect" href="simple.html" title="Simple">Simple</a> then the result of the expression evaluation is the file name to be used - eg if you set </p>
-<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
-<pre class="code-java">move=../backup/copy-of-${file:name}</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> <p>move=../backup/copy-of-$</p>
+<div class="error"><span class="error">Unknown macro: {file}</span> </div></div>
 <p> then that's using the <a shape="rect" href="file-language.html" title="File Language">File Language</a> which we use return the file name to be used), 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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>    from("file://inobox?delete=true").to("bean:handleOrder");</p></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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>    from("file://inbox?preMove=inprogress").to("bean:handleOrder");</p></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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>    from("file://inbox?preMove=inprogress&amp;move=.done").to("bean:handleOrder");</p></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="File2-FinegrainedcontroloverMoveandPreMoveoption"></a>Fine grained control over Move and PreMove option</h4>
@@ -189,11 +173,11 @@ Notice from <b>Camel 2.10</b> onwards th
 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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>move=backup/$</p>
+<div class="error"><span class="error">Unknown macro: {date}</span> </div>
+<p>/$</p>
+<div class="error"><span class="error">Unknown macro: {file}</span> </div></div>
 
 <h4><a shape="rect" name="File2-AboutmoveFailed"></a>About moveFailed</h4>
 
@@ -237,46 +221,34 @@ move=backup/${date:now:yyyyMMdd}/${file:
 <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>)
-  .to(<span class="code-quote">"file:outbox?charset=iso-8859-1"</span>)
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file:inbox?charset=utf-8")<br clear="none">
+  .to("file:outbox?charset=iso-8859-1")</p></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>)
-  .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>);
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file:inbox?charset=utf-8")<br clear="none">
+  .convertBodyTo(byte[].class, "iso-8859-1")<br clear="none">
+  .to("bean:myBean")<br clear="none">
+  .to("file:outbox");</p></div>
 
 <p>If you omit the charset on the consumer endpoint, then Camel does not know the charset of the file, and would by default use "UTF-8". However you can configure a JVM system property to override and use a different default encoding with the key <tt>org.apache.camel.default.charset</tt>.</p>
 
 <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>)
-  .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>);
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file:inbox")<br clear="none">
+  .convertBodyTo(byte[].class, "iso-8859-1")<br clear="none">
+  .to("bean:myBean")<br clear="none">
+  .to("file:outbox");</p></div>
 
 <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>)
-  .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>))
-  .to(<span class="code-quote">"file:outbox"</span>);
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file:inbox")<br clear="none">
+  .convertBodyTo(byte[].class, "iso-8859-1")<br clear="none">
+  .to("bean:myBean")<br clear="none">
+  .setProperty(Exchange.CHARSET_NAME, header("someCharsetHeader"))<br clear="none">
+  .to("file:outbox");</p></div>
 
 <p>We suggest to keep things simpler, so if you pickup files with the same encoding, and want to write the files in a specific encoding, then favor to use the <tt>charset</tt> option on the endpoints.</p>
 
@@ -284,48 +256,30 @@ 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>)
-  .to(<span class="code-quote">"file:outbox?charset=iso-8859-1"</span>)
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file:inbox?charset=utf-8")<br clear="none">
+  .to("file:outbox?charset=iso-8859-1")</p></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
-DEBUG FileOperations                 - Using Reader to write file: target/charset/output.txt with charset: iso-8859-1
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>DEBUG GenericFileConverter           - Read file /Users/davsclaus/workspace/camel/camel-core/target/charset/input/input.txt with charset utf-8<br clear="none">
+DEBUG FileOperations                 - Using Reader to write file: target/charset/output.txt with charset: iso-8859-1</p></div>
 
 <h3><a shape="rect" name="File2-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>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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("direct:report").to("file:target/reports");</p></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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("direct:report").setHeader(Exchange.FILE_NAME, constant("report.txt")).to( "file:target/reports");</p></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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("direct:report").setHeader("CamelFileName", constant("report.txt")).to( "file:target/reports");</p></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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("direct:report").to("file:target/reports/?fileName=report.txt");</p></div>
 
 <h3><a shape="rect" name="File2-FilenameExpression"></a>Filename Expression</h3>
 
@@ -343,31 +297,26 @@ from(<span class="code-quote">"direct:re
 <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>
-<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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file:bar?doneFileName=done");</p></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>
 
 <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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file:bar?doneFileName=$</p>
+<div class="error"><span class="error">Unknown macro: {file}</span> </div>
+<p>.done");</p></div>
 
 <p>In this example only files will be polled if there exists a done file with the name <em>file name</em>.done. For example</p>
 <ul class="alternate" type="square"><li><tt>hello.txt</tt> - is the file to be consumed</li><li><tt>hello.txt.done</tt> - is the associated done file</li></ul>
 
 
 <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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file:bar?doneFileName=ready-$</p>
+<div class="error"><span class="error">Unknown macro: {file}</span> </div>
+<p>");</p></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>
 
 
@@ -378,256 +327,195 @@ from(<span class="code-quote">"file:bar?
 <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>
-<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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>.to("file:bar?doneFileName=done");</p></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>
 
-<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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>.to("file:bar?doneFileName=done-$</p>
+<div class="error"><span class="error">Unknown macro: {file}</span> </div>
+<p>");</p></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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>.to("file:bar?doneFileName=$</p>
+<div class="error"><span class="error">Unknown macro: {file}</span> </div>
+<p>.done");</p></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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>.to("file:bar?doneFileName=$</p>
+<div class="error"><span class="error">Unknown macro: {file}</span> </div>
+<p>.done");</p></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>
 
 <h3><a shape="rect" name="File2-Samples"></a>Samples</h3>
 
 <h4><a shape="rect" name="File2-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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file://inputdir/?delete=true").to("file://outputdir")</p></div>
 
 <h4><a shape="rect" name="File2-Readfromadirectoryandwritetoanotherdirectoryusingaoverruledynamicname"></a>Read from a directory and write to another directory using a overrule dynamic name</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?overruleFile=copy-of-${file:name}"</span>)</span>
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file://inputdir/?delete=true").to("file://outputdir?overruleFile=copy-of-$</p>
+<div class="error"><span class="error">Unknown macro: {file}</span> </div>
+<p>")</p></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>.</p>
 
 <h4><a shape="rect" name="File2-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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file://inputdir/?recursive=true&amp;delete=true").to("file://outputdir")</p></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
-inputdir/sub/bar.txt
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>inputdir/foo.txt<br clear="none">
+inputdir/sub/bar.txt</p></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
-outputdir/sub/bar.txt
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>outputdir/foo.txt<br clear="none">
+outputdir/sub/bar.txt</p></div>
 
 <h5><a shape="rect" name="File2-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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file://inputdir/?recursive=true&amp;delete=true").to("file://outputdir?flatten=true")</p></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
-outputdir/bar.txt
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>outputdir/foo.txt<br clear="none">
+outputdir/bar.txt</p></div>
 
 <h4><a shape="rect" name="File2-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>
-<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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file://inputdir/?recursive=true&amp;delete=true").to("file://outputdir")</p></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
-inputdir/sub/bar.txt
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>inputdir/foo.txt<br clear="none">
+inputdir/sub/bar.txt</p></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
-inputdir/sub/.camel/bar.txt
-outputdir/foo.txt
-outputdir/sub/bar.txt
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>inputdir/.camel/foo.txt<br clear="none">
+inputdir/sub/.camel/bar.txt<br clear="none">
+outputdir/foo.txt<br clear="none">
+outputdir/sub/bar.txt</p></div>
 
 <h4><a shape="rect" name="File2-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() {
-</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
-</span>  }
-});
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file://inputdir/").process(new Processor() {<br clear="none">
+  public void process(Exchange exchange) throws Exception </p>
+<div class="error"><span class="error">Unknown macro: {
+    Object body = exchange.getIn().getBody();
+    // do some business logic with the input body
+  }</span> </div>
+<p>});</p></div>
 
 <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="File2-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 {
-    MockEndpoint mock = getMockEndpoint(<span class="code-quote">"mock:result"</span>);
-    mock.expectedMessageCount(1);
-    mock.expectedFileExists(<span class="code-quote">"target/test-reports/report.txt"</span>);
-
-    template.sendBody(<span class="code-quote">"direct:reports"</span>, <span class="code-quote">"This is a great report"</span>);
-
-    assertMockEndpointsSatisfied();
-}
-
-<span class="code-keyword">protected</span> JndiRegistry createRegistry() <span class="code-keyword">throws</span> Exception {
-    <span class="code-comment">// bind our processor in the registry with the given id
-</span>    JndiRegistry reg = <span class="code-keyword">super</span>.createRegistry();
-    reg.bind(<span class="code-quote">"processReport"</span>, <span class="code-keyword">new</span> ProcessReport());
-    <span class="code-keyword">return</span> reg;
-}
-
-<span class="code-keyword">protected</span> RouteBuilder createRouteBuilder() <span class="code-keyword">throws</span> Exception {
-    <span class="code-keyword">return</span> <span class="code-keyword">new</span> RouteBuilder() {
-        <span class="code-keyword">public</span> void configure() <span class="code-keyword">throws</span> Exception {
-            <span class="code-comment">// the reports from the seda queue is processed by our processor
-</span>            <span class="code-comment">// before they are written to files in the target/reports directory
-</span>            from(<span class="code-quote">"direct:reports"</span>).processRef(<span class="code-quote">"processReport"</span>).to(<span class="code-quote">"file:<span class="code-comment">//target/test-reports"</span>, <span class="code-quote">"mock:result"</span>);
-</span>        }
-    };
-}
-
-<span class="code-keyword">private</span> <span class="code-keyword">static</span> class ProcessReport <span class="code-keyword">implements</span> Processor {
-
-    <span class="code-keyword">public</span> void process(Exchange exchange) <span class="code-keyword">throws</span> Exception {
-        <span class="code-object">String</span> body = exchange.getIn().getBody(<span class="code-object">String</span>.class);
-        <span class="code-comment">// <span class="code-keyword">do</span> some business logic here
-</span>
-        <span class="code-comment">// set the output to the file
-</span>        exchange.getOut().setBody(body);
-
-        <span class="code-comment">// set the output filename using java code logic, notice that <span class="code-keyword">this</span> is done by setting
-</span>        <span class="code-comment">// a special header property of the out exchange
-</span>        exchange.getOut().setHeader(Exchange.FILE_NAME, <span class="code-quote">"report.txt"</span>);
-    }
-
-}
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>public void testToFile() throws Exception {<br clear="none">
+    MockEndpoint mock = getMockEndpoint("mock:result");<br clear="none">
+    mock.expectedMessageCount(1);<br clear="none">
+    mock.expectedFileExists("target/test-reports/report.txt");</p>
+
+<p>    template.sendBody("direct:reports", "This is a great report");</p>
+
+<p>    assertMockEndpointsSatisfied();<br clear="none">
+}</p>
+
+<p>protected JndiRegistry createRegistry() throws Exception {<br clear="none">
+    // bind our processor in the registry with the given id<br clear="none">
+    JndiRegistry reg = super.createRegistry();<br clear="none">
+    reg.bind("processReport", new ProcessReport());<br clear="none">
+    return reg;<br clear="none">
+}</p>
+
+<p>protected RouteBuilder createRouteBuilder() throws Exception {<br clear="none">
+    return new RouteBuilder() {<br clear="none">
+        public void configure() throws Exception </p>
+<div class="error"><span class="error">Unknown macro: {            // the reports from the seda queue is processed by our processor            // before they are written to files in the target/reports directory            from("direct}</span> </div>
+<p>    };<br clear="none">
+}</p>
+
+<p>private static class ProcessReport implements Processor {</p>
+
+<p>    public void process(Exchange exchange) throws Exception </p>
+<div class="error"><span class="error">Unknown macro: {        String body = exchange.getIn().getBody(String.class);        // do some business logic here
+        // set the output to the file        exchange.getOut().setBody(body);
+        // set the output filename using java code logic, notice that this is done by setting        // a special header property of the out exchange        exchange.getOut().setHeader(Exchange.FILE_NAME, "report.txt");    }</span> </div>
+
+<p>}</p></div>
 
 <h4><a shape="rect" name="File2-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;
-    &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;
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>  &lt;route&gt;<br clear="none">
+    &lt;from uri="bean:myBean"/&gt;<br clear="none">
+    &lt;to uri="file:/rootDirectory"/&gt;<br clear="none">
+  &lt;/route&gt;</p></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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>Exchange.FILE_NAME = hello.txt =&gt; /rootDirectory/hello.txt<br clear="none">
+Exchange.FILE_NAME = foo/bye.txt =&gt; /rootDirectory/foo/bye.txt</p></div>
 
 <p>This allows you to have a single route to write files to multiple destinations.</p>
 
 <h4><a shape="rect" name="File2-Usingexpressionforfilenames"></a>Using expression for filenames</h4>
 
 <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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file://inbox?move=backup/$</p>
+<div class="error"><span class="error">Unknown macro: {date}</span> </div>
+<p>/$</p>
+<div class="error"><span class="error">Unknown macro: {file}</span> </div>
+<p>").to("...");</p></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="File2-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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>from("file://inbox?idempotent=true").to("...");</p></div>
 
 <p>Camel uses the absolute file name as the idempotent key, to detect duplicate files. From <b>Camel 2.11</b> onwards you can customize this key by using an expression in the idempotentKey option. For example to use both the name and the file size as the key</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>
-    <span class="code-tag">&lt;from uri=<span class="code-quote">"file://inbox?idempotent=true&amp;amp;idempotentKey=${file:name}-${file-size}"</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>
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>  &lt;route&gt;<br clear="none">
+    &lt;from uri="file://inbox?idempotent=true&amp;idempotentKey=$</p>
+<div class="error"><span class="error">Unknown macro: {file}</span> </div>
+<p>-$</p>
+<div class="error"><span class="error">Unknown macro: {file-size}</span> </div>
+<p>"/&gt;<br clear="none">
+    &lt;to uri="bean:processInbox"/&gt;<br clear="none">
+  &lt;/route&gt;</p></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>
-   <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>
-    <span class="code-tag">&lt;from uri=<span class="code-quote">"file://inbox?idempotent=true&amp;amp;idempotentRepository=#myStore"</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>
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>   &lt;!-- define our store as a plain spring bean --&gt;<br clear="none">
+   &lt;bean id="myStore" class="com.mycompany.MyIdempotentStore"/&gt;</p>
+
+<p>  &lt;route&gt;<br clear="none">
+    &lt;from uri="file://inbox?idempotent=true&amp;idempotentRepository=#myStore"/&gt;<br clear="none">
+    &lt;to uri="bean:processInbox"/&gt;<br clear="none">
+  &lt;/route&gt;</p></div>
 
 <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>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>DEBUG FileConsumer is idempotent and the file has been consumed before. Will skip this file: target\idempotent\report.txt</p></div>
 
 
 <h4><a shape="rect" name="File2-Usingafilebasedidempotentrepository"></a>Using a file based idempotent repository</h4>
@@ -636,26 +524,26 @@ DEBUG FileConsumer is idempotent and the
 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>
-<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;!-- this is our file based idempotent store configured to use the .filestore.dat as file --&gt;</span></span>
-<span class="code-tag">&lt;bean id=<span class="code-quote">"fileStore"</span> class=<span class="code-quote">"org.apache.camel.processor.idempotent.FileIdempotentRepository"</span>&gt;</span>
-    <span class="code-tag"><span class="code-comment">&lt;!-- the filename for the store --&gt;</span></span>
-    <span class="code-tag">&lt;property name=<span class="code-quote">"fileStore"</span> value=<span class="code-quote">"target/fileidempotent/.filestore.dat"</span>/&gt;</span>
-    &lt;!-- the max filesize in bytes for the file. Camel will trunk and flush the cache
-         if the file gets bigger --&gt;
-    <span class="code-tag">&lt;property name=<span class="code-quote">"maxFileStoreSize"</span> value=<span class="code-quote">"512000"</span>/&gt;</span>
-    <span class="code-tag"><span class="code-comment">&lt;!-- the number of elements in our store --&gt;</span></span>
-    <span class="code-tag">&lt;property name=<span class="code-quote">"cacheSize"</span> value=<span class="code-quote">"250"</span>/&gt;</span>
-<span class="code-tag">&lt;/bean&gt;</span>
-
-<span class="code-tag">&lt;camelContext xmlns=<span class="code-quote">"http://camel.apache.org/schema/spring"</span>&gt;</span>
-    <span class="code-tag">&lt;route&gt;</span>
-        <span class="code-tag">&lt;from uri=<span class="code-quote">"file://target/fileidempotent/?idempotent=true&amp;amp;idempotentRepository=#fileStore&amp;amp;move=done/${file:name}"</span>/&gt;</span>
-        <span class="code-tag">&lt;to uri=<span class="code-quote">"mock:result"</span>/&gt;</span>
-    <span class="code-tag">&lt;/route&gt;</span>
-<span class="code-tag">&lt;/camelContext&gt;</span>
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>&lt;!-- this is our file based idempotent store configured to use the .filestore.dat as file --&gt;<br clear="none">
+&lt;bean id="fileStore" class="org.apache.camel.processor.idempotent.FileIdempotentRepository"&gt;<br clear="none">
+    &lt;!-- the filename for the store --&gt;<br clear="none">
+    &lt;property name="fileStore" value="target/fileidempotent/.filestore.dat"/&gt;<br clear="none">
+    &lt;!-- the max filesize in bytes for the file. Camel will trunk and flush the cache<br clear="none">
+         if the file gets bigger --&gt;<br clear="none">
+    &lt;property name="maxFileStoreSize" value="512000"/&gt;<br clear="none">
+    &lt;!-- the number of elements in our store --&gt;<br clear="none">
+    &lt;property name="cacheSize" value="250"/&gt;<br clear="none">
+&lt;/bean&gt;</p>
+
+<p>&lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;<br clear="none">
+    &lt;route&gt;<br clear="none">
+        &lt;from uri="file://target/fileidempotent/?idempotent=true&amp;idempotentRepository=#fileStore&amp;move=done/$</p>
+<div class="error"><span class="error">Unknown macro: {file}</span> </div>
+<p>"/&gt;<br clear="none">
+        &lt;to uri="mock:result"/&gt;<br clear="none">
+    &lt;/route&gt;<br clear="none">
+&lt;/camelContext&gt;</p></div>
 
 
 <h4><a shape="rect" name="File2-UsingaJPAbasedidempotentrepository"></a>Using a JPA based idempotent repository</h4>
@@ -663,88 +551,73 @@ This repository uses a 1st level cache t
 <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">
-<pre class="code-xml"><span class="code-tag">&lt;persistence-unit name=<span class="code-quote">"idempotentDb"</span> transaction-type=<span class="code-quote">"RESOURCE_LOCAL"</span>&gt;</span>
-  <span class="code-tag">&lt;class&gt;</span>org.apache.camel.processor.idempotent.jpa.MessageProcessed<span class="code-tag">&lt;/class&gt;</span>
-
-  <span class="code-tag">&lt;properties&gt;</span>
-    <span class="code-tag">&lt;property name=<span class="code-quote">"openjpa.ConnectionURL"</span> value=<span class="code-quote">"jdbc:derby:target/idempotentTest;create=true"</span>/&gt;</span>
-    <span class="code-tag">&lt;property name=<span class="code-quote">"openjpa.ConnectionDriverName"</span> value=<span class="code-quote">"org.apache.derby.jdbc.EmbeddedDriver"</span>/&gt;</span>
-    <span class="code-tag">&lt;property name=<span class="code-quote">"openjpa.jdbc.SynchronizeMappings"</span> value=<span class="code-quote">"buildSchema"</span>/&gt;</span>
-    <span class="code-tag">&lt;property name=<span class="code-quote">"openjpa.Log"</span> value=<span class="code-quote">"DefaultLevel=WARN, Tool=INFO"</span>/&gt;</span>
-  <span class="code-tag">&lt;/properties&gt;</span>
-<span class="code-tag">&lt;/persistence-unit&gt;</span>
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>&lt;persistence-unit name="idempotentDb" transaction-type="RESOURCE_LOCAL"&gt;<br clear="none">
+  &lt;class&gt;org.apache.camel.processor.idempotent.jpa.MessageProcessed&lt;/class&gt;</p>
+
+<p>  &lt;properties&gt;<br clear="none">
+    &lt;property name="openjpa.ConnectionURL" value="jdbc:derby:target/idempotentTest;create=true"/&gt;<br clear="none">
+    &lt;property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.EmbeddedDriver"/&gt;<br clear="none">
+    &lt;property name="openjpa.jdbc.SynchronizeMappings" value="buildSchema"/&gt;<br clear="none">
+    &lt;property name="openjpa.Log" value="DefaultLevel=WARN, Tool=INFO"/&gt;<br clear="none">
+  &lt;/properties&gt;<br clear="none">
+&lt;/persistence-unit&gt;</p></div>
 
 <p>Then we need to setup a Spring <tt>jpaTemplate</tt> in the spring XML file:</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;!-- this is standard spring JPA configuration --&gt;</span></span>
-<span class="code-tag">&lt;bean id=<span class="code-quote">"jpaTemplate"</span> class=<span class="code-quote">"org.springframework.orm.jpa.JpaTemplate"</span>&gt;</span>
-    <span class="code-tag">&lt;property name=<span class="code-quote">"entityManagerFactory"</span> ref=<span class="code-quote">"entityManagerFactory"</span>/&gt;</span>
-<span class="code-tag">&lt;/bean&gt;</span>
-
-<span class="code-tag">&lt;bean id=<span class="code-quote">"entityManagerFactory"</span> class=<span class="code-quote">"org.springframework.orm.jpa.LocalEntityManagerFactoryBean"</span>&gt;</span>
-    <span class="code-tag"><span class="code-comment">&lt;!-- we use idempotentDB as the persitence unit name defined in the persistence.xml file --&gt;</span></span>
-    <span class="code-tag">&lt;property name=<span class="code-quote">"persistenceUnitName"</span> value=<span class="code-quote">"idempotentDb"</span>/&gt;</span>
-<span class="code-tag">&lt;/bean&gt;</span>
-</pre>
-</div></div>
+<div class="error"><span class="error">Unknown macro: {code}</span> 
+<p>&lt;!-- this is standard spring JPA configuration --&gt;<br clear="none">
+&lt;bean id="jpaTemplate" class="org.springframework.orm.jpa.JpaTemplate"&gt;<br clear="none">
+    &lt;property name="entityManagerFactory" ref="entityManagerFactory"/&gt;<br clear="none">
+&lt;/bean&gt;</p>
+
+<p>&lt;bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalEntityManagerFactoryBean"&gt;<br clear="none">
+    &lt;!-- we use idempotentDB as the persitence unit name defined in the persistence.xml file --&gt;<br clear="none">
+    &lt;property name="persistenceUnitName" value="idempotentDb"/&gt;<br clear="none">
+&lt;/bean&gt;</p></div>
 
 <p>And finally we can create our JPA idempotent repository in the spring XML file as well:</p>
-<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">

[... 524 lines stripped ...]