camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r961145 [2/2] - in /websites/production/camel/content: book-in-one-page.html book-languages-appendix.html cache/main.pageCache file-language.html
Date Sat, 08 Aug 2015 11:19:40 GMT
Modified: websites/production/camel/content/file-language.html
==============================================================================
--- websites/production/camel/content/file-language.html (original)
+++ websites/production/camel/content/file-language.html Sat Aug  8 11:19:40 2015
@@ -85,7 +85,7 @@
 	<tbody>
         <tr>
         <td valign="top" width="100%">
-<div class="wiki-content maincontent"><h2 id="FileLanguage-FileExpressionLanguage">File
Expression Language</h2><div class="confluence-information-macro confluence-information-macro-information"><p
class="title">File language is now merged with Simple language</p><span class="aui-icon
aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><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>
comp
 onents 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 file 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 th
 e <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 colspan="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.singleext</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td
colspan="1" rowspan="1" class="confluenceTd">yes</td><td colspan="1" rowspan="1"
class="confluenceTd">no</td><td c
 olspan="1" rowspan="1" class="confluenceTd">yes</td><td colspan="1" rowspan="1"
class="confluenceTd">no</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel
2.14.4/2.15.3:</strong> refers to the file extension. If the file extension has mutiple
dots, then this expression strips and only returns the last part.</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:name.nosingleext</td><td colspan="1"
rowspan="1"
  class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd">yes</td><td
colspan="1" rowspan="1" class="confluenceTd">no</td><td colspan="1" rowspan="1"
class="confluenceTd">yes</td><td colspan="1" rowspan="1" class="confluenceTd">no</td><td
colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.14.4/2.15.3:</strong><span>
<span>refers to the file name with no extension (is relative to the starting directory,
see note below)</span>. If the file extension has multiple dots, then this expression
strips only the last part, and keep the others.</span></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:onlyname.nosingleext</td><td colspan="1"
rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd">yes</td><td
colspan="1" rowspan="1" class="confluenceTd">no</td><td colspan="1" rowspan="1"
class="confluenceTd">yes</td><td colspan="1" rowspan="1" class="confluence
 Td">no</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel
2.14.4/2.15.3: </strong>refers to the file name only with no extension and with no leading
paths. I<span>f the file extension has multiple dots, then this expression strips only
the last part, and keep the others.</span></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 col
 span="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="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 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="confluen
 ceTd"><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"
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 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" cla
 ss="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="confluenceTd"><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\tes
 t\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>
directory: <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="confluen
 ceTh"><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>\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">
+<div class="wiki-content maincontent"><h2 id="FileLanguage-FileExpressionLanguage">File
Expression Language</h2><div class="confluence-information-macro confluence-information-macro-information"><p
class="title">File language is now merged with Simple language</p><span class="aui-icon
aui-icon-small aui-iconfont-info confluence-information-macro-icon"></span><div
class="confluence-information-macro-body"><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>
comp
 onents 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 file 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 th
 e <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 colspan="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.ext.single</td><td colspan="1" rowspan="1" class="confluenceTd">String</td><td
colspan="1" rowspan="1" class="confluenceTd">yes</td><td colspan="1" rowspan="1"
class="confluenceTd">no</td><td 
 colspan="1" rowspan="1" class="confluenceTd">yes</td><td colspan="1" rowspan="1"
class="confluenceTd">no</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel
2.14.4/2.15.3:</strong> refers to the file extension. If the file extension has mutiple
dots, then this expression strips and only returns the last part.</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:name.noext.single</td><td colspan="1"
rowspan="
 1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd">yes</td><td
colspan="1" rowspan="1" class="confluenceTd">no</td><td colspan="1" rowspan="1"
class="confluenceTd">yes</td><td colspan="1" rowspan="1" class="confluenceTd">no</td><td
colspan="1" rowspan="1" class="confluenceTd"><strong>Camel 2.14.4/2.15.3:</strong><span>
<span>refers to the file name with no extension (is relative to the starting directory,
see note below)</span>. If the file extension has multiple dots, then this expression
strips only the last part, and keep the others.</span></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:onlyname.noext.single</td><td colspan="1"
rowspan="1" class="confluenceTd">String</td><td colspan="1" rowspan="1" class="confluenceTd">yes</td><td
colspan="1" rowspan="1" class="confluenceTd">no</td><td colspan="1" rowspan="1"
class="confluenceTd">yes</td><td colspan="1" rowspan="1" class="conflue
 nceTd">no</td><td colspan="1" rowspan="1" class="confluenceTd"><strong>Camel
2.14.4/2.15.3: </strong>refers to the file name only with no extension and with no leading
paths. I<span>f the file extension has multiple dots, then this expression strips only
the last part, and keep the others.</span></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="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 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="confl
 uenceTd"><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"
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 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="confluenceTd"><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>f
 ile</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>
directory: <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="confl
 uenceTh"><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" cl
 ass="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="brush: java; gutter: false; theme: Default" 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