0

I am using Camel to route files from a network path using file component. But my user credentiails doesn't have read/write access rights for that path, hence I am unable to pick up files.

If I want to access the files in the path as a different user [only for that path], how can I configure that in Camel? And for multiple paths there are specific user credentials to be used. So my broader issue is how can I say Camel to use a particular user for accessing particular path?

2 Answers2

0

I can't see that this is possible via the camel configuration options for the file2 component to configure a different user.

Your best course of action may be to grant the 'r' rights you require to a camel user consistently across all the locations you want to read files from, or to create symbolic links that have the correct access rights.

vikingsteve
  • 38,481
  • 23
  • 112
  • 156
  • Is it possible to somehow make the whole application run as a different user? Like having a properties file or any other configuration. – maverick_27 Apr 15 '15 at 06:45
  • If you start the camel executable, or your container if you are using one, as a different user, then that user will be used by default for the file component. Alternatively you could look at using ftp, that's another option, or the answer from string05. – vikingsteve Apr 15 '15 at 06:46
0

Have you had a look at the jcifs component?

http://camel.apache.org/jcifs.html

from("smb://otheruser@myserver.example.com/sharename?password=otheruserspassword&localWorkDirectory=/tmp")
  .to("bean:foo"); 
stringy05
  • 6,511
  • 32
  • 38