Camel - 如何根据相同文件夹中其他文件的存在移动文件

时间:2017-11-02 08:41:01

标签: apache-camel

让我们说在Temp文件夹中我有(一个,两个,三个,四个,五个)5个文件,我希望这些文件到Test文件夹。

我的问题是在这里我想移动'one.txt'文件,如果'three.txt'文件存在,那么一个,两个文件都必须移动临时文件夹。相同方式('two.txt'文件,如果'five.txt')。

我对apache很新 - 骆驼和我的路线看起来像下面

<route id="Helloworld">
<camel:from uri="file:C:\\Temp?noop=true"></camel:from>
<camel:choice>
    <camel:when>
        <camel:simple>${file:onlyname.noext} regex 'one'</camel:simple>
        <camel:choice>
            <camel:when>
                <method ref="myBean" method="predicateThatChecksIfFileExists(${file:parent}\\three.xml)" />
                -- Here i want to move one and three both the files has to move Test folder
            </camel:when>
        </camel:choice>
    </camel:when>
</camel:choice>

这里发生了什么,每个文件从文件夹中获取并处理它但我们无法检查同一文件夹中的其他文件。任何人都可以建议我,这样做的最佳方式是什么?

0 个答案:

没有答案
相关问题