16.3. 例

相対パス名

File コンシューマーエンドポイントに、開始ディレクトリーが相対パス名で指定されているシナリオを考えてみます。たとえば、以下の File エンドポイントの開始ディレクトリーは ./filelanguage であるとします。

file://filelanguage

そして、filelanguage ディレクトリーをスキャンしている間、エンドポイントが以下のファイルを読み込んだとします。

./filelanguage/test/hello.txt

そして最後に、filelanguage ディレクトリー自体が以下のような絶対位置にあるとします。

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

前述のシナリオで、File 言語の File 変数を、現在のエクスチェンジに適用した場合、以下の値が返されます。

表現結果

file:name

test/hello.txt

file:name.ext

txt

file:name.noext

test/hello

file:onlyname

hello.txt

file:onlyname.noext

hello

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

絶対パス名

File コンシューマーエンドポイントに、開始ディレクトリーが 絶対パス名 で指定されているシナリオを考えてみます。たとえば、以下の File エンドポイントには、開始ディレクトリー /workspace/camel/camel-core/target/filelanguage があります。

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

そして、filelanguage ディレクトリーをスキャンしている間、エンドポイントが以下のファイルを読み込んだとします。

./filelanguage/test/hello.txt

前述のシナリオで、File 言語の File 変数を、現在のエクスチェンジに適用した場合、以下の値が返されます。

表現結果

file:name

test/hello.txt

file:name.ext

txt

file:name.noext

test/hello

file:onlyname

hello.txt

file:onlyname.noext

hello

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