在camel-ftp中将目录从home更改为root [英] Changing directory from home to root in camel-ftp

查看:35
本文介绍了在camel-ftp中将目录从home更改为root的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 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&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>

现在,这是有效的.它能够 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆