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>
Now, this is working. It is able to sftp my file.
Problem is I want my file to be at: /nas/tst2/inputfiles. But it is going at: /home/user1/nas/tst2/inputfiles
Now, how can I make it for going it at /nas/tst2/inputfiles? /nas/ and /home/ both are on <root>/.
The problem is changing this default /home/.
Which attribute can I use? I am not able to find or understand how to do it in Camel DSL.
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.