camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r941291 [2/2] - in /websites/production/camel/content: book-in-one-page.html book-languages-appendix.html cache/main.pageCache file-language.html
Date Tue, 24 Feb 2015 11:18:50 GMT
Modified: websites/production/camel/content/file-language.html
==============================================================================
--- websites/production/camel/content/file-language.html (original)
+++ websites/production/camel/content/file-language.html Tue Feb 24 11:18:49 2015
@@ -92,7 +92,7 @@
                             <p>From Camel 2.2 onwards, the file language is now merged
with <a shape="rect" href="simple.html">Simple</a> language which means you can
use all the file syntax directly within the simple language.</p>
                     </div>
     </div>
-<p>The File Expression Language is an extension to the <a shape="rect" href="simple.html">Simple</a>
language, adding file related capabilities. These capabilities are related to common use cases
working with file path and names. The goal is to allow expressions to be used with the <a
shape="rect" href="file2.html">File</a> and <a shape="rect" href="ftp.html">FTP</a>
components for setting dynamic file patterns for both consumer and producer.</p><h3
id="FileLanguage-Syntax">Syntax</h3><p>This language is an <strong>extension</strong>
to the <a shape="rect" href="simple.html">Simple</a> language so the <a shape="rect"
href="simple.html">Simple</a> syntax applies also. So the table below only lists
the additional. <br clear="none"> As opposed to <a shape="rect" href="simple.html">Simple</a>
language <a shape="rect" href="file-language.html">File Language</a> also supports
<a shape="rect" href="constant.html">Constant</a> expressions so you can enter
a fixed filename.</p><p>All the fil
 e tokens use the same expression name as the method on the <code>java.io.File</code>
object, for instance <code>file:absolute</code> refers to the <code>java.io.File.getAbsolute()</code>
method. Notice that not all expressions are supported by the current Exchange. For instance
the <a shape="rect" href="ftp.html">FTP</a> component supports some of the options,
where as the <a shape="rect" href="file2.html">File</a> component supports all
of them.</p><div class="confluenceTableSmall"><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Expression</p></th><th
colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1"
rowspan="1" class="confluenceTh"><p>File Consumer</p></th><th colspan="1"
rowspan="1" class="confluenceTh"><p>File Producer</p></th><th colspan="1"
rowspan="1" class="confluenceTh"><p>FTP Consumer</p></th><th colspan="1"
rowspan="1" class="confluenceTh"><p>FTP Producer</p></th><th colspan="
 1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>refers to the file name (is relative to the starting directory,
see note below)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">file:name.ext</td><td
colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
cols
 pan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.3:</strong>
refers to the file extension only</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">file:name.noext</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>refers to the file name with no extension (is relative to
the starting directory, see note below)</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">file:onlyname</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes<
 /p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>refers to the file name only with
no leading paths.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">file:onlyname.noext</td><td colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>refers to the file name only with
no extension and with no leading paths.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">file:ext</td><td colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan=
 "1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>refers to the file extension only</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:parent</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>refers to the file parent</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:path</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="conflu
 enceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>refers to the file path</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:absolute</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Boolean</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>refers to whether the file is regarded as absolute
or relative</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">file:absolute.path</td><td
colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
clas
 s="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>refers to the absolute file path</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:length</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Long</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>refers
to the file length returned as a Long type</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:size</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Long</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1"
rowspan="1" class="confluen
 ceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.5:</strong>
refers to the file length returned as a Long type</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:modified</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Date</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>efers to the file last modified returned as a Date type</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p>date:<em>command:pattern</em></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class=
 "confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>for date formatting using the <code>java.text.SimepleDateFormate</code>
patterns. Is an <strong>extension</strong> to the <a shape="rect" href="simple.html">Simple</a>
language. Additional command is: <strong>file</strong> (consumers only) for the
last modified timestamp of the file. Notice: all the commands from the <a shape="rect"
href="simple.html">Simple</a> language can also be used.</p></td></tr></tbody></table></div></div><h3
id="FileLanguage-Filetokenexample">File token example</h3><h4 id="FileLanguage-Relativepaths">Relative
paths</h4><p>We have a <code>java.io.File</code> handle for the file
<code>hello.txt</code> in the following <strong>relative</strong>
directory: <code>.\filelanguage\test</code>. And we configure our endpoint to
use this starting directory <code>
 .\filelanguage</code>. The file tokens will return as:</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Expression</p></th><th
colspan="1" rowspan="1" class="confluenceTh"><p>Returns</p></th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>test\hello.txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name.ext</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name.noext</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>test\hello</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:onlyname</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>hello.txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:onlyname.noext</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>hello</p></td></tr
 ><tr><td colspan="1" rowspan="1" class="confluenceTd">file:ext</td><td
colspan="1" rowspan="1" class="confluenceTd"><p>txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:parent</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>filelanguage\test</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:path</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>filelanguage\test\hello.txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:absolute</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>false</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:absolute.path</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>\workspace\camel\camel-core\target\filelanguage\test\hello.txt</p></td></tr></tbody></table></div><h4
id="FileLanguage-Absolutepaths">Absolute paths</h4><p>We have a <code>java.io.File</code>
handle for the file <code>hello.txt</code> in the following <strong>absolute</strong>
d
 irectory: <code>\workspace\camel\camel-core\target\filelanguage\test</code>.
And we configure out endpoint to use the absolute starting directory <code>\workspace\camel\camel-core\target\filelanguage</code>.
The file tokens will return as:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th
colspan="1" rowspan="1" class="confluenceTh"><p>Expression</p></th><th
colspan="1" rowspan="1" class="confluenceTh"><p>Returns</p></th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>test\hello.txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name.ext</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name.noext</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>test\hello</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:onlyname</td><td colspan="1"
rowspan="1" class="co
 nfluenceTd"><p>hello.txt</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">file:onlyname.noext</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>hello</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">file:ext</td><td colspan="1" rowspan="1" class="confluenceTd"><p>txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:parent</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>\workspace\camel\camel-core\target\filelanguage\test</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:path</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>\workspace\camel\camel-core\target\filelanguage\test\hello.txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:absolute</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>true</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:absolute.path</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>\workspace\camel\camel-co
 re\target\filelanguage\test\hello.txt</p></td></tr></tbody></table></div><h3
id="FileLanguage-Samples">Samples</h3><p>You can enter a fixed <a shape="rect"
href="constant.html">Constant</a> expression such as <code>myfile.txt</code>:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
+<p>The File Expression Language is an extension to the <a shape="rect" href="simple.html">Simple</a>
language, adding file related capabilities. These capabilities are related to common use cases
working with file path and names. The goal is to allow expressions to be used with the <a
shape="rect" href="file2.html">File</a> and <a shape="rect" href="ftp.html">FTP</a>
components for setting dynamic file patterns for both consumer and producer.</p><h3
id="FileLanguage-Syntax">Syntax</h3><p>This language is an <strong>extension</strong>
to the <a shape="rect" href="simple.html">Simple</a> language so the <a shape="rect"
href="simple.html">Simple</a> syntax applies also. So the table below only lists
the additional. <br clear="none"> As opposed to <a shape="rect" href="simple.html">Simple</a>
language <a shape="rect" href="file-language.html">File Language</a> also supports
<a shape="rect" href="constant.html">Constant</a> expressions so you can enter
a fixed filename.</p><p>All the fil
 e tokens use the same expression name as the method on the <code>java.io.File</code>
object, for instance <code>file:absolute</code> refers to the <code>java.io.File.getAbsolute()</code>
method. Notice that not all expressions are supported by the current Exchange. For instance
the <a shape="rect" href="ftp.html">FTP</a> component supports some of the options,
where as the <a shape="rect" href="file2.html">File</a> component supports all
of them.</p><div class="confluenceTableSmall"><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Expression</p></th><th
colspan="1" rowspan="1" class="confluenceTh"><p>Type</p></th><th colspan="1"
rowspan="1" class="confluenceTh"><p>File Consumer</p></th><th colspan="1"
rowspan="1" class="confluenceTh"><p>File Producer</p></th><th colspan="1"
rowspan="1" class="confluenceTh"><p>FTP Consumer</p></th><th colspan="1"
rowspan="1" class="confluenceTh"><p>FTP Producer</p></th><th colspan="
 1" rowspan="1" class="confluenceTh"><p>Description</p></th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>refers to the file name (is relative to the starting directory,
see note below)</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">file:name.ext</td><td
colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
cols
 pan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.3:</strong>
refers to the file extension only</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">file:name.noext</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>refers to the file name with no extension (is relative to
the starting directory, see note below)</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">file:onlyname</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes<
 /p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>refers to the file name only with
no leading paths.</p></td></tr><tr><td colspan="1" rowspan="1"
class="confluenceTd">file:onlyname.noext</td><td colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>refers to the file name only with
no extension and with no leading paths.</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">file:ext</td><td colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan=
 "1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>refers to the file extension only</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:parent</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>refers to the file parent</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:path</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>String</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="conflu
 enceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>refers to the file path</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:absolute</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Boolean</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>refers to whether the file is regarded as absolute
or relative</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">file:absolute.path</td><td
colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
clas
 s="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>refers to the absolute file path</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:length</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Long</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>refers
to the file length returned as a Long type</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:size</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>Long</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1"
rowspan="1" class="confluen
 ceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p><strong>Camel 2.5:</strong>
refers to the file length returned as a Long type</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:modified</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>Date</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>no</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>no</p></td><td colspan="1" rowspan="1"
class="confluenceTd"><p>efers to the file last modified returned as a Date type</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p>date:<em>command:pattern</em></p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>String</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class=
 "confluenceTd"><p>yes</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p>yes</p></td><td colspan="1"
rowspan="1" class="confluenceTd"><p>for date formatting using the <code>java.text.SimpleDateFormat</code>
patterns. Is an <strong>extension</strong> to the <a shape="rect" href="simple.html">Simple</a>
language. Additional command is: <strong>file</strong> (consumers only) for the
last modified timestamp of the file. Notice: all the commands from the <a shape="rect"
href="simple.html">Simple</a> language can also be used.</p></td></tr></tbody></table></div></div><h3
id="FileLanguage-Filetokenexample">File token example</h3><h4 id="FileLanguage-Relativepaths">Relative
paths</h4><p>We have a <code>java.io.File</code> handle for the file
<code>hello.txt</code> in the following <strong>relative</strong>
directory: <code>.\filelanguage\test</code>. And we configure our endpoint to
use this starting directory <code>.\
 filelanguage</code>. The file tokens will return as:</p><div class="table-wrap"><table
class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Expression</p></th><th
colspan="1" rowspan="1" class="confluenceTh"><p>Returns</p></th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>test\hello.txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name.ext</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name.noext</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>test\hello</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:onlyname</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>hello.txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:onlyname.noext</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>hello</p></td></tr><
 tr><td colspan="1" rowspan="1" class="confluenceTd">file:ext</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:parent</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>filelanguage\test</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:path</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>filelanguage\test\hello.txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:absolute</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>false</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:absolute.path</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>\workspace\camel\camel-core\target\filelanguage\test\hello.txt</p></td></tr></tbody></table></div><h4
id="FileLanguage-Absolutepaths">Absolute paths</h4><p>We have a <code>java.io.File</code>
handle for the file <code>hello.txt</code> in the following <strong>absolute</strong>
dir
 ectory: <code>\workspace\camel\camel-core\target\filelanguage\test</code>. And
we configure out endpoint to use the absolute starting directory <code>\workspace\camel\camel-core\target\filelanguage</code>.
The file tokens will return as:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th
colspan="1" rowspan="1" class="confluenceTh"><p>Expression</p></th><th
colspan="1" rowspan="1" class="confluenceTh"><p>Returns</p></th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>test\hello.txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name.ext</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:name.noext</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>test\hello</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:onlyname</td><td colspan="1"
rowspan="1" class="conf
 luenceTd"><p>hello.txt</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">file:onlyname.noext</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>hello</p></td></tr><tr><td colspan="1"
rowspan="1" class="confluenceTd">file:ext</td><td colspan="1" rowspan="1" class="confluenceTd"><p>txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:parent</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>\workspace\camel\camel-core\target\filelanguage\test</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:path</td><td colspan="1" rowspan="1"
class="confluenceTd"><p>\workspace\camel\camel-core\target\filelanguage\test\hello.txt</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:absolute</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>true</p></td></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd">file:absolute.path</td><td colspan="1"
rowspan="1" class="confluenceTd"><p>\workspace\camel\camel-core
 \target\filelanguage\test\hello.txt</p></td></tr></tbody></table></div><h3
id="FileLanguage-Samples">Samples</h3><p>You can enter a fixed <a shape="rect"
href="constant.html">Constant</a> expression such as <code>myfile.txt</code>:</p><div
class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent
pdl">
 <script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[fileName=&quot;myfile.txt&quot;
 ]]></script>
 </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
archieved using an expression like:</p><div class="code panel pdl" style="border-width:
1px;"><div class="codeContent panelContent pdl">



Mime
View raw message