在camel-ftp中将目录从home更改为root

Suk*_*rit 2 dsl apache-camel camel-ftp

我在 Apache Camel 配置中使用以下内容:

<camel:route errorHandlerRef="loggingErrorHandler" id="ROUTE_ICL">

    <camel:from uri="file:{{camel.route.icl.from.file.path}}?filter=#fileFilterMAVRO&amp;initialDelay={{camel.route.from.file.initialDelay}}&amp;delay={{camel.route.from.file.delay}}&amp;useFixedDelay=true&amp;runLoggingLevel=TRACE&amp;startingDirectoryMustExist={{camel.route.from.file.startingDirectoryMustExist}}&amp;autoCreate={{camel.route.from.file.autoCreate}}&amp;maxMessagesPerPoll={{camel.route.from.file.maxMessagesPerPoll}}&amp;eagerMaxMessagesPerPoll=true&amp;delete=false&amp;readLock=idempotent&amp;readLockLoggingLevel=OFF&amp;readLockRemoveOnRollback=false&amp;readLockRemoveOnCommit=false&amp;idempotent=true&amp;idempotentKey=${file:onlyname}&amp;idempotentRepository=#iclMessageIdRepository&amp;recursive=false&amp;move={{camel.route.icl.complete.file.path}}&amp;moveFailed={{camel.route.icl.failed.file.path}}" />

    <camel:to uri="sftp://user1@ecomt199.qintra.com:22/nas/tst2/inputfiles?password=Pass1234&amp;runLoggingLevel=TRACE"/>

</camel:route>
Run Code Online (Sandbox Code Playgroud)

现在,这正在发挥作用。它能够通过 sftp 传输我的文件。

问题是我希望我的文件位于:/nas/tst2/inputfiles。但它位于:/home/user1/nas/tst2/inputfiles

现在,我怎样才能让它进入/nas/tst2/inputfiles?/nas/ 和 /home/ 都位于 <root>/ 上。

问题是更改默认的/home/

我可以使用哪个属性?我无法找到或理解如何在 Camel DSL 中执行此操作。

mco*_*ode 5

Camel 在当前版本中确实不允许使用完全限定的路径。但是,只要用户拥有权限,您就可以使用这样的路径作为解决方法:

../../../../../../../../this_is_the_root_folder/usr/....
Run Code Online (Sandbox Code Playgroud)

您基本上从用户的目录开始,然后在树中向上直到到达根目录。您只需要确保添加了足够的内容../../即可到达根目录。

这不是最好的解决方案,但它很简单并且对我有用。