gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 03:50:01 25 4
gpt4 key购买 nike

我在 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://<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e297918790d3a287818d8f96d3dbdbcc938b8c969083cc818d8f" rel="noreferrer noopener nofollow">[email protected]</a>:22/nas/tst2/inputfiles?password=Pass1234&amp;runLoggingLevel=TRACE"/>

</camel:route>

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

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

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

问题在于更改此默认值/home/

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

最佳答案

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

../../../../../../../../this_is_the_root_folder/usr/....

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

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

关于apache-camel - 在camel-ftp中将目录从home更改为root,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45759853/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com