-
Bug
-
Resolution: Done
-
Major
-
3.8.0.GA
-
None
-
False
-
-
False
-
-
-
-
Important
-
0
Consider this trivial camel-smb route:
<from uri="smb:192.168.1.10:445/temp?path=/test&username=kevin&password=***&searchPattern=*.text"/> <to uri="log://foo"/>
The remote share `temp` contains a directory `test`, in which there is a file `test.text`.
This route fails, with the following exception:
024-11-07 13:20:20,068 WARN [org.apa.cam.com.smb.SmbConsumer] (Camel (camel-1) thread #1 - smb://192.168.1.10:445/temp) Failed polling endpoint: smb://192.168.1.10:445/temp?password=xxxxxx&path=%2Ftest&searchPattern=*.text&username=xxxxxx. Will try again at next poll. Caused by: [com.hierynomus.mssmb2.SMBApiException - STATUS_OBJECT_NAME_NOT_FOUND (0xc0000034): Create failed for \\192.168.1.10\temp\test.text]: com.hierynomus.mssmb2.SMBApiException: STATUS_OBJECT_NAME_NOT_FOUND (0xc0000034): Create failed for \\192.168.1.10\temp\test.text
at com.hierynomus.smbj.share.Share.receive(Share.java:380)
at com.hierynomus.smbj.share.Share.sendReceive(Share.java:359)
camel-smb has correctly detected that there is a file `test.text` in the directory `temp`. But when it goes to read the file, it actually looks for `
test.text` in the share `temp`. That is, it seems to be ignoring the path when reading the file, that it correctly used when scanning for files.
This means that camel-smb does not work for values of `path` other than `/`, the top-level directory of the share.
As an aside, I note that the camel-smb component writes an INFO log message every time it polls, which makes the log very noisy. In addition, although the documentation says that the default value of `searchPattern` is `*.txt`, this does not appear to be the case.