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&initialDelay={{camel.route.from.file.initialDelay}}&delay={{camel.route.from.file.delay}}&useFixedDelay=true&runLoggingLevel=TRACE&startingDirectoryMustExist={{camel.route.from.file.startingDirectoryMustExist}}&autoCreate={{camel.route.from.file.autoCreate}}&maxMessagesPerPoll={{camel.route.from.file.maxMessagesPerPoll}}&eagerMaxMessagesPerPoll=true&delete=false&readLock=idempotent&readLockLoggingLevel=OFF&readLockRemoveOnRollback=false&readLockRemoveOnCommit=false&idempotent=true&idempotentKey=${file:onlyname}&idempotentRepository=#iclMessageIdRepository&recursive=false&move={{camel.route.icl.complete.file.path}}&moveFailed={{camel.route.icl.failed.file.path}}" />
<camel:to uri="sftp://user1@ecomt199.qintra.com:22/nas/tst2/inputfiles?password=Pass1234&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 中执行此操作。
Camel 在当前版本中确实不允许使用完全限定的路径。但是,只要用户拥有权限,您就可以使用这样的路径作为解决方法:
../../../../../../../../this_is_the_root_folder/usr/....
Run Code Online (Sandbox Code Playgroud)
您基本上从用户的目录开始,然后在树中向上直到到达根目录。您只需要确保添加了足够的内容../../即可到达根目录。
这不是最好的解决方案,但它很简单并且对我有用。