...
This language is an extension to the Simple language so the Simple syntax applies also. So the table below only lists the additional.
As opposed to Simple language File Language also supports Constant expressions so you can enter a fixed filename.
All the file tokens uses the same expression name as the method on the java.io.File
object, for instance file:absolute
refers to the java.io.File.getAbsolute()
method. Notice that not all expressions is supported by the current Exchange. For instance the FTP component only supports a few of the options, where as the File component support all of them.
...
Expression | Returns |
---|---|
file:name | hello.txt |
file:name.noext | hello |
file:parent | target\filelanguage |
file:path | target\filelanguage\hello.txt |
file:absolute.path | D:\project\camel\camel-core\target\filelanguage\hello.txt |
file:canonical.path | D:\project\camel\camel-core\target\filelanguage\hello.txt |
Samples
You can enter a fixed Constant expression such as myfile.txt
:
Code Block |
---|
expression="myfile.txt"
|
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:
...