在camel-ftp中将目录从home更改为root [英] Changing directory from home to root in camel-ftp
问题描述
我在我的 Apache Camel 配置中使用以下内容:
I am using the following in my Apache Camel configuration:
<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>
现在,这是有效的.它能够 sftp 我的文件.
Now, this is working. It is able to sftp my file.
问题是我希望我的文件位于:/nas/tst2/inputfiles.但它是在:/home/user1/nas/tst2/inputfiles
Problem is I want my file to be at: /nas/tst2/inputfiles. But it is going at: /home/user1/nas/tst2/inputfiles
现在,我如何才能在 /nas/tst2/inputfiles 中访问它?/nas/和/home/都在
Now, how can I make it for going it at /nas/tst2/inputfiles? /nas/ and /home/ both are on <root>/.
问题是改变这个默认值/home/.
The problem is changing this default /home/.
我可以使用哪个属性?我无法在 Camel DSL 中找到或了解如何执行此操作.
Which attribute can I use? I am not able to find or understand how to do it in Camel DSL.
推荐答案
Camel 在当前版本中确实不允许完全限定路径.但是,只要用户具有权限,您就可以使用这样的路径作为解决方法:
Camel indeed doesn't allow fully qualified paths in the current version. However, as long as the user has the privileges, you could use a path like this as a workaround:
../../../../../../../../this_is_the_root_folder/usr/....
您基本上从用户的目录开始,然后在树中向上直到到达根目录.您只需要确保添加了足够的 ../../
即可到达根目录.
You basically start with the user's directory and then go up in the tree until you reach root. You only need to make sure that you added enough ../../
to get to the root.
这不是最好的解决方案,但它很简单并且对我有用.
It is not the nicest solution, but it is simple and worked for me.
这篇关于在camel-ftp中将目录从home更改为root的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!