camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From conflue...@apache.org
Subject [CONF] Apache Camel > File Language
Date Sat, 25 Sep 2010 13:15:00 GMT
<html>
<head>
    <base href="https://cwiki.apache.org/confluence">
            <link rel="stylesheet" href="/confluence/s/1810/9/1/_/styles/combined.css?spaceKey=CAMEL&amp;forWysiwyg=true"
type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://cwiki.apache.org/confluence/display/CAMEL/File+Language">File
Language</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://cwiki.apache.org/confluence/display/~muellerc">Christian
Mueller</a>
    </h4>
        <br/>
                         <h4>Changes (1)</h4>
                                 
    
<div id="page-diffs">
            <table class="diff" cellpadding="0" cellspacing="0">
            <tr><td class="diff-snipped" >...<br></td></tr>
            <tr><td class="diff-unchanged" >    &lt;/choice&gt; <br>{code}
<br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">
<br>If you use Springs PropertyPlaceholderConfigurer in conjunction with the file language,
make sure you set the property {{ignoreUnresolvablePlaceholders}} to {{true}}.  <br>{code:title=bundle-context.xml}
<br>&lt;bean id=&quot;propertyPlaceholder&quot; class=&quot;org.springframework.beans.factory.config.PropertyPlaceholderConfigurer&quot;&gt;
<br>    &lt;property name=&quot;ignoreUnresolvablePlaceholders&quot; value=&quot;true&quot;
/&gt; <br>    &lt;property name=&quot;location&quot; value=&quot;classpath:bundle-context.cfg&quot;
/&gt; <br>&lt;/bean&gt; <br> <br>&lt;bean id=&quot;fileRoute&quot;
class=&quot;com.company.FileRoute&quot;&gt; <br>    &lt;property name=&quot;fromEndpoint&quot;
value=&quot;${com.company.FileRoute.fromEndpoint}&quot; /&gt; <br>    &lt;property
name=&quot;toEndpoint&quot; value=&quot;${com.company.FileRoute.toEndpoint}&quot;
/&gt; <br>&lt;/bean&gt; <br>{code} <br>{code:title=bundle-context.cfg}
<br>com.company.FileRoute.fromEndpoint=activemq:queue:test <br>com.company.FileRoute.toEndpoint=file://fileRoute/out?fileName=test-${date:now:yyyyMMdd}.txt
<br>{code} <br>Otherwise you will receive an exception like <br>{code} <br>org.springframework.beans.factory.BeanDefinitionStoreException:
Invalid bean definition with name &#39;fileRoute&#39; defined in class path resource
[bundle-context.xml]: Could not resolve placeholder &#39;date:now:yyyyMMdd&#39; <br>{code}
<br></td></tr>
            <tr><td class="diff-unchanged" >{tip}  <br> <br></td></tr>
            <tr><td class="diff-snipped" >...<br></td></tr>
        </table>
</div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <h2><a name="FileLanguage-FileExpressionLanguage"></a>File Expression
Language</h2>

<p><b>Available as of Camel 1.5</b></p>

<div class='panelMacro'><table class='infoMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/information.gif" width="16"
height="16" align="absmiddle" alt="" border="0"></td><td><b>File language
is now merged with Simple language</b><br />From Camel 2.2 onwards, the file language
is now merged with <a href="/confluence/display/CAMEL/Simple" title="Simple">Simple</a>
language which means you can use all the file syntax directly within the simple language.</td></tr></table></div>

<p>The File Expression Language is an extension to the <a href="/confluence/display/CAMEL/Simple"
title="Simple">Simple</a> language, adding file related capabilities. These capabilities
is related to common use cases working with file path and names. The goal is to allow expression
to be used with the <a href="/confluence/display/CAMEL/File" title="File">File</a>
and <a href="/confluence/display/CAMEL/FTP" title="FTP">FTP</a> components for
setting dynamic file patterns for both consumer and producer. </p>

<h3><a name="FileLanguage-Syntax"></a>Syntax</h3>
<p>This language is an <b>extension</b> to the <a href="/confluence/display/CAMEL/Simple"
title="Simple">Simple</a> language so the <a href="/confluence/display/CAMEL/Simple"
title="Simple">Simple</a> syntax applies also. So the table below only lists the
additional. <br/>
As opposed to <a href="/confluence/display/CAMEL/Simple" title="Simple">Simple</a>
language <a href="/confluence/display/CAMEL/File+Language" title="File Language">File
Language</a> also supports <a href="/confluence/display/CAMEL/Constant" title="Constant">Constant</a>
expressions so you can enter a fixed filename.</p>

<p>All the file tokens uses the same expression name as the method on the <tt>java.io.File</tt>
object, for instance <tt><a href="file:absolute" class="external-link" rel="nofollow">file:absolute</a></tt>
refers to the <tt>java.io.File.getAbsolute()</tt> method. Notice that not all
expressions is supported by the current Exchange. For instance the <a href="/confluence/display/CAMEL/FTP"
title="FTP">FTP</a> component supports some of the options, where as the <a href="/confluence/display/CAMEL/File"
title="File">File</a> component support all of them.</p>

<div class="confluenceTableSmall"><div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Expression </th>
<th class='confluenceTh'> Type </th>
<th class='confluenceTh'> File Consumer </th>
<th class='confluenceTh'> File Producer </th>
<th class='confluenceTh'> FTP Consumer </th>
<th class='confluenceTh'> FTP Producer </th>
<th class='confluenceTh'> Description </th>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:name" class="external-link" rel="nofollow">file:name</a>
</td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> refers to the file name (is relative to the starting directory,
see note below) </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:name.ext" class="external-link" rel="nofollow">file:name.ext</a>
</td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> <b>Camel 2.3:</b> refers to the file extension
only </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:name.noext" class="external-link" rel="nofollow">file:name.noext</a>
</td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> refers to the file name with no extension (is relative to
the starting directory, see note below) </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:onlyname" class="external-link" rel="nofollow">file:onlyname</a>
</td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> <b>Camel 2.0:</b> refers to the file name only
with no leading paths. </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:onlyname.noext" class="external-link" rel="nofollow">file:onlyname.noext</a>
</td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> <b>Camel 2.0:</b> refers to the file name only
with no extension and with no leading paths. </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:ext" class="external-link" rel="nofollow">file:ext</a>
</td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> <b>Camel 1.6.1/Camel 2.0:</b> refers to the file
extension only </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:parent" class="external-link" rel="nofollow">file:parent</a>
</td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> refers to the file parent </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:path" class="external-link" rel="nofollow">file:path</a>
</td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> refers to the file path </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:absolute" class="external-link" rel="nofollow">file:absolute</a>
</td>
<td class='confluenceTd'> Boolean </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> <b>Camel 2.0:</b> refers to whether the file is
regarded as absolute or relative </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:absolute.path" class="external-link" rel="nofollow">file:absolute.path</a>
</td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> refers to the absolute file path </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:length" class="external-link" rel="nofollow">file:length</a>
</td>
<td class='confluenceTd'> Long </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> refers to the file length returned as a Long type </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:size" class="external-link" rel="nofollow">file:size</a>
</td>
<td class='confluenceTd'> Long </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> <b>Camel 2.5:</b> refers to the file length returned
as a Long type </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:modified" class="external-link" rel="nofollow">file:modified</a>
</td>
<td class='confluenceTd'> Date </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> no </td>
<td class='confluenceTd'> <b>Camel 2.0:</b> refers to the file last modified
returned as a Date type </td>
</tr>
<tr>
<td class='confluenceTd'> date:<em>command:pattern</em> </td>
<td class='confluenceTd'> String </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> yes </td>
<td class='confluenceTd'> for date formatting using the <tt>java.text.SimepleDataFormat</tt>
patterns. Is an <b>extension</b> to the <a href="/confluence/display/CAMEL/Simple"
title="Simple">Simple</a> language. Additional command is: <b>file</b>
(consumers only) for the last modified timestamp of the file. Notice: all the commands from
the <a href="/confluence/display/CAMEL/Simple" title="Simple">Simple</a> language
can also be used. </td>
</tr>
</tbody></table>
</div>
</div>

<h3><a name="FileLanguage-Filetokenexample"></a>File token example</h3>

<h4><a name="FileLanguage-Relativepaths"></a>Relative paths</h4>
<p>We have a <tt>java.io.File</tt> handle for the file <tt>hello.txt</tt>
in the following <b>relative</b> directory: <tt>.\filelanguage\test</tt>.
And we configure out endpoint to use this starting directory <tt>.\filelanguage</tt>.
The the file tokens will return as:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Expression </th>
<th class='confluenceTh'> Returns </th>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:name" class="external-link" rel="nofollow">file:name</a>
</td>
<td class='confluenceTd'> test\hello.txt </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:name.ext" class="external-link" rel="nofollow">file:name.ext</a>
</td>
<td class='confluenceTd'> txt </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:name.noext" class="external-link" rel="nofollow">file:name.noext</a>
</td>
<td class='confluenceTd'> test\hello </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:onlyname" class="external-link" rel="nofollow">file:onlyname</a>
</td>
<td class='confluenceTd'> hello.txt </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:onlyname.noext" class="external-link" rel="nofollow">file:onlyname.noext</a>
</td>
<td class='confluenceTd'> hello </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:ext" class="external-link" rel="nofollow">file:ext</a>
</td>
<td class='confluenceTd'> txt </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:parent" class="external-link" rel="nofollow">file:parent</a>
</td>
<td class='confluenceTd'> filelanguage\test </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:path" class="external-link" rel="nofollow">file:path</a>
</td>
<td class='confluenceTd'> filelanguage\test\hello.txt </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:absolute" class="external-link" rel="nofollow">file:absolute</a>
</td>
<td class='confluenceTd'> false </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:absolute.path" class="external-link" rel="nofollow">file:absolute.path</a>
</td>
<td class='confluenceTd'> \workspace\camel\camel-core\target\filelanguage\test\hello.txt
</td>
</tr>
</tbody></table>
</div>


<h4><a name="FileLanguage-Absolutepaths"></a>Absolute paths</h4>
<p>We have a <tt>java.io.File</tt> handle for the file <tt>hello.txt</tt>
in the following <b>absolute</b> directory: <tt>\workspace\camel\camel-core\target\filelanguage\test</tt>.
And we configure out endpoint to use the absolute starting directory <tt>\workspace\camel\camel-core\target\filelanguage</tt>.
The the file tokens will return as:</p>
<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<th class='confluenceTh'> Expression </th>
<th class='confluenceTh'> Returns </th>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:name" class="external-link" rel="nofollow">file:name</a>
</td>
<td class='confluenceTd'> test\hello.txt </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:name.ext" class="external-link" rel="nofollow">file:name.ext</a>
</td>
<td class='confluenceTd'> txt </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:name.noext" class="external-link" rel="nofollow">file:name.noext</a>
</td>
<td class='confluenceTd'> test\hello </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:onlyname" class="external-link" rel="nofollow">file:onlyname</a>
</td>
<td class='confluenceTd'> hello.txt </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:onlyname.noext" class="external-link" rel="nofollow">file:onlyname.noext</a>
</td>
<td class='confluenceTd'> hello </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:ext" class="external-link" rel="nofollow">file:ext</a>
</td>
<td class='confluenceTd'> txt </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:parent" class="external-link" rel="nofollow">file:parent</a>
</td>
<td class='confluenceTd'> \workspace\camel\camel-core\target\filelanguage\test </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:path" class="external-link" rel="nofollow">file:path</a>
</td>
<td class='confluenceTd'> \workspace\camel\camel-core\target\filelanguage\test\hello.txt
</td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:absolute" class="external-link" rel="nofollow">file:absolute</a>
</td>
<td class='confluenceTd'> true </td>
</tr>
<tr>
<td class='confluenceTd'> <a href="file:absolute.path" class="external-link" rel="nofollow">file:absolute.path</a>
</td>
<td class='confluenceTd'> \workspace\camel\camel-core\target\filelanguage\test\hello.txt
</td>
</tr>
</tbody></table>
</div>


<h3><a name="FileLanguage-Samples"></a>Samples</h3>
<p>You can enter a fixed <a href="/confluence/display/CAMEL/Constant" title="Constant">Constant</a>
expression such as <tt>myfile.txt</tt>:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
fileName=<span class="code-quote">"myfile.txt"</span>
</pre>
</div></div>

<p>Lets assume we use the file consumer to read files and want to move the read files
to backup folder with the current date as a sub folder. This can be archived using an expression
like:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
fileName=<span class="code-quote">"backup/${date:now:yyyyMMdd}/${file:name.noext}.bak"</span>
</pre>
</div></div>

<p>relative folder names is also supported so suppose the backup folder should be a
sibling folder then you can append .. as:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
fileName=<span class="code-quote">"../backup/${date:now:yyyyMMdd}/${file:name.noext}.bak"</span>
</pre>
</div></div>

<p>As this is an extension to the <a href="/confluence/display/CAMEL/Simple" title="Simple">Simple</a>
language we have access to all the goodies from this language also, so in this use case we
want to use the in.header.type as a parameter in the dynamic expression:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
fileName=<span class="code-quote">"../backup/${date:now:yyyyMMdd}/type-${in.header.type}/backup-of-${file:name.noext}.bak"</span>
</pre>
</div></div>

<p>If you have a custom Date you want to use in the expression then Camel supports retrieving
dates from the message header.</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
fileName=<span class="code-quote">"orders/order-${in.header.customerId}-${date:in.header.orderDate:yyyyMMdd}.xml"</span>
</pre>
</div></div>

<p>And finally we can also use a bean expression to invoke a POJO class that generates
some String output (or convertible to String) to be used:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
fileName=<span class="code-quote">"uniquefile-${bean:myguidgenerator.generateid}.txt"</span>
</pre>
</div></div>

<p>And of course all this can be combined in one expression where you can use the <a
href="/confluence/display/CAMEL/File+Language" title="File Language">File Language</a>,
<a href="/confluence/display/CAMEL/Simple" title="Simple">Simple</a> and the <a
href="/confluence/display/CAMEL/Bean" title="Bean">Bean</a> language in one combined
expression. This is pretty powerful for those common file path patterns.</p>

<div class='panelMacro'><table class='tipMacro'><colgroup><col width='24'><col></colgroup><tr><td
valign='top'><img src="/confluence/images/icons/emoticons/check.gif" width="16" height="16"
align="absmiddle" alt="" border="0"></td><td><b>Can be used in Spring
XML</b><br />In Camel 2.2 you can use the <a href="/confluence/display/CAMEL/File+Language"
title="File Language">File Language</a> directly from the <a href="/confluence/display/CAMEL/Simple"
title="Simple">Simple</a> language which makes a <a href="/confluence/display/CAMEL/Content+Based+Router"
title="Content Based Router">Content Based Router</a> more easy to do in Spring XML,
where we can route based on file extensions as shown below:
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml">
  <span class="code-tag">&lt;from uri=<span class="code-quote">"file://input/orders"</span>/&gt;</span>
     <span class="code-tag">&lt;choice&gt;</span>
       <span class="code-tag">&lt;when&gt;</span>
           <span class="code-tag">&lt;simple&gt;</span>${file:ext} ==
'txt'<span class="code-tag">&lt;/simple&gt;</span>
           <span class="code-tag">&lt;to uri=<span class="code-quote">"bean:orderService?method=handleTextFiles"</span>/&gt;</span>
       <span class="code-tag">&lt;/when&gt;</span>
       <span class="code-tag">&lt;when&gt;</span>
           <span class="code-tag">&lt;simple&gt;</span>${file:ext} ==
'xml'<span class="code-tag">&lt;/simple&gt;</span>
           <span class="code-tag">&lt;to uri=<span class="code-quote">"bean:orderService?method=handleXmlFiles"</span>/&gt;</span>
       <span class="code-tag">&lt;/when&gt;</span>
       <span class="code-tag">&lt;otherwise&gt;</span>
           <span class="code-tag">&lt;to uri=<span class="code-quote">"bean:orderService?method=handleOtherFiles"</span>/&gt;</span>
       <span class="code-tag">&lt;/otherwise&gt;</span>
    <span class="code-tag">&lt;/choice&gt;</span>
</pre>
</div></div>

<p>If you use Springs PropertyPlaceholderConfigurer in conjunction with the file language,
make sure you set the property <tt>ignoreUnresolvablePlaceholders</tt> to <tt>true</tt>.
</p>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>bundle-context.xml</b></div><div
class="codeContent panelContent">
<pre class="code-java">
&lt;bean id=<span class="code-quote">"propertyPlaceholder"</span> class=<span
class="code-quote">"org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"</span>&gt;
    &lt;property name=<span class="code-quote">"ignoreUnresolvablePlaceholders"</span>
value=<span class="code-quote">"<span class="code-keyword">true</span>"</span>
/&gt;
    &lt;property name=<span class="code-quote">"location"</span> value=<span
class="code-quote">"classpath:bundle-context.cfg"</span> /&gt;
&lt;/bean&gt;

&lt;bean id=<span class="code-quote">"fileRoute"</span> class=<span class="code-quote">"com.company.FileRoute"</span>&gt;
    &lt;property name=<span class="code-quote">"fromEndpoint"</span> value=<span
class="code-quote">"${com.company.FileRoute.fromEndpoint}"</span> /&gt;
    &lt;property name=<span class="code-quote">"toEndpoint"</span> value=<span
class="code-quote">"${com.company.FileRoute.toEndpoint}"</span> /&gt;
&lt;/bean&gt;
</pre>
</div></div>
<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader"
style="border-bottom-width: 1px;"><b>bundle-context.cfg</b></div><div
class="codeContent panelContent">
<pre class="code-java">
com.company.FileRoute.fromEndpoint=activemq:queue:test
com.company.FileRoute.toEndpoint=file:<span class="code-comment">//fileRoute/out?fileName=test-${date:now:yyyyMMdd}.txt</span>
</pre>
</div></div>
<p>Otherwise you will receive an exception like</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">
org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with
name 'fileRoute' defined in class path resource [bundle-context.xml]: Could not resolve placeholder
'date:now:yyyyMMdd'
</pre>
</div></div></td></tr></table></div> 


<h3><a name="FileLanguage-Dependencies"></a>Dependencies</h3>
<p>The File language is part of <b>camel-core</b>.</p>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;">
            <a href="https://cwiki.apache.org/confluence/users/viewnotifications.action"
class="grey">Change Notification Preferences</a>
        </div>
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/File+Language">View
Online</a>
        |
        <a href="https://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=95383&revisedVersion=34&originalVersion=33">View
Changes</a>
                |
        <a href="https://cwiki.apache.org/confluence/display/CAMEL/File+Language?showComments=true&amp;showCommentArea=true#addcomment">Add
Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>

Mime
View raw message