16.3. 例子

相对路径名

请考虑文件消费者端点,其中起始目录指定为 相对路径名。例如,以下 File 端点包含起始目录 ./filelanguage

file://filelanguage

现在,在扫描 文件语言 目录时,假设端点只消耗了以下文件:

./filelanguage/test/hello.txt

最后,假设 filelanguage 目录本身具有以下绝对位置:

/workspace/camel/camel-core/target/filelanguage

根据上述情况,文件语言变量会在应用到当前交换时返回以下值:

表达式结果

file:name

test/hello.txt

file:name.ext

txt

file:name.noext

test/hello

file:onlyname

hello.txt

file:onlyname.noext

您好

file:ext

txt

file:parent

filelanguage/test

file:path

filelanguage/test/hello.txt

file:absolute

false

file:absolute.path

/workspace/camel/camel-core/target/filelanguage/test/hello.txt

绝对路径名称

请考虑文件消费者端点,其中起始目录指定为 绝对路径名。例如,以下文件端点包含起始目录 /workspace/camel/camel-core/target/filelanguage

file:///workspace/camel/camel-core/target/filelanguage

现在,在扫描 文件语言 目录时,假设端点只消耗了以下文件:

./filelanguage/test/hello.txt

根据上述情况,文件语言变量会在应用到当前交换时返回以下值:

表达式结果

file:name

test/hello.txt

file:name.ext

txt

file:name.noext

test/hello

file:onlyname

hello.txt

file:onlyname.noext

您好

file:ext

txt

file:parent

/workspace/camel/camel-core/target/filelanguage/test

file:path

/workspace/camel/camel-core/target/filelanguage/test/hello.txt

file:absolute

true

file:absolute.path

/workspace/camel/camel-core/target/filelanguage/test/hello.txt