[jira] [Commented] (CAMEL-13400) Camel FTP Cannot list directory with 'File not found' prepending additional '/' in front of directory automatically

2019-05-19 Thread Roberto Flores (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-13400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16843645#comment-16843645
 ] 

Roberto Flores commented on CAMEL-13400:


Hi.

I have just sent a PR. Could you please give it a look.

Regards,

Roberto.

> Camel FTP Cannot list directory with 'File not found' prepending additional 
> '/' in front of directory automatically
> ---
>
> Key: CAMEL-13400
> URL: https://issues.apache.org/jira/browse/CAMEL-13400
> Project: Camel
>  Issue Type: Bug
>  Components: camel-ftp
>Affects Versions: 3.0.0-M1
>Reporter: Vidhya Sagar Jeevendran
>Priority: Major
> Fix For: 3.0.0
>
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> I need to poll files form a dynamic folder based on a specific date, so I 
> have provided the parent directory in endpoint URI, enabled recursive flag 
> and add filterDirectory accordingly. But It is not able to poll from the 
> directory, it says file not found for that directory. It is trying with an 
> addition '/' while listing {{listFor(/)}}
> *Endpoint URI*
> {{sftp://:22051?connectTimeout=9&disconnect=true&filterDirectory=%24%7Bfile%3Aname%7D+starts+with+%27%24%7Bbean%3AdateofExchange%3Fmethod%3DforLoc%28%22MY%22%29%7D%27&flatten=true&include=.*IMG&knownHostsFile=C%3A%5Cprogram+files%5Cascertain%5CI2R-MystiQ-Engine%5Cknown_hosts&noop=true&password=xx&preferredAuthentications=password&reconnectDelay=3&recursive=true&scheduler=quartz2&scheduler.cron=0+0%2F5+*+*+*+%3F&stepwise=false&username=_ftpuser
>  }}
> *TRACE LOG*
> {{TRACE 2019-04-05T15:25:03,389 
> [org.apache.camel.component.file.remote.SftpConsumer] - Polling directory: 
> TRACE 2019-04-05T15:25:03,389 
> [org.apache.camel.component.file.remote.SftpOperations] - listFiles() TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - Found 12 in directory: TRACE 2019-04-05T15:25:03,712 
> [org.apache.camel.component.file.remote.SftpConsumer] - SftpFile[fileName=., 
> longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 05:27 ., dir=true] TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - File did not match. Will skip this file: RemoteFile[.] TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - SftpFile[fileName=.., longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 03:04 .., dir=true] TRACE 2019-04-05T15:25:03,712 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[..] TRACE 2019-04-05T15:25:03,728 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20170526, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 02:16 20170526, dir=true] TRACE 2019-04-05T15:25:04,413 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20170526] TRACE 2019-04-05T15:25:04,413 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181119, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:24 20181119, dir=true] TRACE 2019-04-05T15:25:05,117 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181119] TRACE 2019-04-05T15:25:05,117 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181121, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:25 20181121, dir=true] TRACE 2019-04-05T15:25:05,837 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181121] TRACE 2019-04-05T15:25:05,840 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181122, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:26 20181122, dir=true] TRACE 2019-04-05T15:25:06,561 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181122] TRACE 2019-04-05T15:25:06,563 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181123, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:27 20181123, dir=true] TRACE 2019-04-05T15:25:07,258 
> [org.apache.camel.component.file.remote.SftpConsumer] - Polling sub 
> directory: /20181123 from: 
> sftp://:22051?connectTimeout=9&disconnect=true&filterDirectory=%24%7Bfile%3Aname%7D+starts+with+%27%24%7Bbean%3AdateofExchange%3Fmethod%3DforLoc%28%22MY%22%29%7D%27&flatten=true&include=.*IMG&knownHostsFile=C%3A%5Cprogram+files%5Cascertain%5CI2R-MystiQ-Engine%5Cknown_hosts&noop=true&password=xx&preferredAuthentications=password&reconnectDelay=3&recursive=true&scheduler=quartz2&scheduler.cron=0+0%2F5+*+*+*+%

[jira] [Commented] (CAMEL-13400) Camel FTP Cannot list directory with 'File not found' prepending additional '/' in front of directory automatically

2019-05-15 Thread Roberto Flores (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-13400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16840995#comment-16840995
 ] 

Roberto Flores commented on CAMEL-13400:


It seems that the 'stepwise=false' attribute is causing the problem.  When it 
is set to false and no base path is provided in the endpoint URI 
(ftp://ZZZ@XXX:YYY?password...) the absolute paths used in the listFiles method 
are generated with the '/' prefix ('/mock/foo'), but if a base path is defined 
in the URI (ftp://ZZZ@XXX:YYY/bar?password...)  the resulting absolute paths do 
not have this prefix ('bar/mock/foo').

However, the issue depends of the server implementation since I tested with the 
embedded FTP server used in the tests and the files were returned normally 
using the absolute paths containing the prefix '/'.

 

> Camel FTP Cannot list directory with 'File not found' prepending additional 
> '/' in front of directory automatically
> ---
>
> Key: CAMEL-13400
> URL: https://issues.apache.org/jira/browse/CAMEL-13400
> Project: Camel
>  Issue Type: Bug
>  Components: camel-ftp
>Affects Versions: 3.0.0-M1
>Reporter: Vidhya Sagar Jeevendran
>Priority: Major
>
> I need to poll files form a dynamic folder based on a specific date, so I 
> have provided the parent directory in endpoint URI, enabled recursive flag 
> and add filterDirectory accordingly. But It is not able to poll from the 
> directory, it says file not found for that directory. It is trying with an 
> addition '/' while listing {{listFor(/)}}
> *Endpoint URI*
> {{sftp://:22051?connectTimeout=9&disconnect=true&filterDirectory=%24%7Bfile%3Aname%7D+starts+with+%27%24%7Bbean%3AdateofExchange%3Fmethod%3DforLoc%28%22MY%22%29%7D%27&flatten=true&include=.*IMG&knownHostsFile=C%3A%5Cprogram+files%5Cascertain%5CI2R-MystiQ-Engine%5Cknown_hosts&noop=true&password=xx&preferredAuthentications=password&reconnectDelay=3&recursive=true&scheduler=quartz2&scheduler.cron=0+0%2F5+*+*+*+%3F&stepwise=false&username=_ftpuser
>  }}
> *TRACE LOG*
> {{TRACE 2019-04-05T15:25:03,389 
> [org.apache.camel.component.file.remote.SftpConsumer] - Polling directory: 
> TRACE 2019-04-05T15:25:03,389 
> [org.apache.camel.component.file.remote.SftpOperations] - listFiles() TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - Found 12 in directory: TRACE 2019-04-05T15:25:03,712 
> [org.apache.camel.component.file.remote.SftpConsumer] - SftpFile[fileName=., 
> longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 05:27 ., dir=true] TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - File did not match. Will skip this file: RemoteFile[.] TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - SftpFile[fileName=.., longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 03:04 .., dir=true] TRACE 2019-04-05T15:25:03,712 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[..] TRACE 2019-04-05T15:25:03,728 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20170526, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 02:16 20170526, dir=true] TRACE 2019-04-05T15:25:04,413 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20170526] TRACE 2019-04-05T15:25:04,413 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181119, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:24 20181119, dir=true] TRACE 2019-04-05T15:25:05,117 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181119] TRACE 2019-04-05T15:25:05,117 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181121, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:25 20181121, dir=true] TRACE 2019-04-05T15:25:05,837 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181121] TRACE 2019-04-05T15:25:05,840 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181122, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:26 20181122, dir=true] TRACE 2019-04-05T15:25:06,561 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181122] TRACE 2019-04-05T15:25:06,563 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181123, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:27 20181123, dir=true] TRACE 2019-04-05T15:25:07,258 
> [org.apache.camel.component.file.remote.SftpConsumer]

[jira] [Commented] (CAMEL-13400) Camel FTP Cannot list directory with 'File not found' prepending additional '/' in front of directory automatically

2019-04-09 Thread Andrea Cosentino (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-13400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16813118#comment-16813118
 ] 

Andrea Cosentino commented on CAMEL-13400:
--

Reopened.

> Camel FTP Cannot list directory with 'File not found' prepending additional 
> '/' in front of directory automatically
> ---
>
> Key: CAMEL-13400
> URL: https://issues.apache.org/jira/browse/CAMEL-13400
> Project: Camel
>  Issue Type: Bug
>  Components: camel-ftp
>Affects Versions: 3.0.0-M1
>Reporter: Vidhya Sagar Jeevendran
>Priority: Major
>
> I need to poll files form a dynamic folder based on a specific date, so I 
> have provided the parent directory in endpoint URI, enabled recursive flag 
> and add filterDirectory accordingly. But It is not able to poll from the 
> directory, it says file not found for that directory. It is trying with an 
> addition '/' while listing {{listFor(/)}}
> *Endpoint URI*
> {{sftp://:22051?connectTimeout=9&disconnect=true&filterDirectory=%24%7Bfile%3Aname%7D+starts+with+%27%24%7Bbean%3AdateofExchange%3Fmethod%3DforLoc%28%22MY%22%29%7D%27&flatten=true&include=.*IMG&knownHostsFile=C%3A%5Cprogram+files%5Cascertain%5CI2R-MystiQ-Engine%5Cknown_hosts&noop=true&password=xx&preferredAuthentications=password&reconnectDelay=3&recursive=true&scheduler=quartz2&scheduler.cron=0+0%2F5+*+*+*+%3F&stepwise=false&username=_ftpuser
>  }}
> *TRACE LOG*
> {{TRACE 2019-04-05T15:25:03,389 
> [org.apache.camel.component.file.remote.SftpConsumer] - Polling directory: 
> TRACE 2019-04-05T15:25:03,389 
> [org.apache.camel.component.file.remote.SftpOperations] - listFiles() TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - Found 12 in directory: TRACE 2019-04-05T15:25:03,712 
> [org.apache.camel.component.file.remote.SftpConsumer] - SftpFile[fileName=., 
> longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 05:27 ., dir=true] TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - File did not match. Will skip this file: RemoteFile[.] TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - SftpFile[fileName=.., longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 03:04 .., dir=true] TRACE 2019-04-05T15:25:03,712 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[..] TRACE 2019-04-05T15:25:03,728 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20170526, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 02:16 20170526, dir=true] TRACE 2019-04-05T15:25:04,413 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20170526] TRACE 2019-04-05T15:25:04,413 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181119, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:24 20181119, dir=true] TRACE 2019-04-05T15:25:05,117 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181119] TRACE 2019-04-05T15:25:05,117 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181121, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:25 20181121, dir=true] TRACE 2019-04-05T15:25:05,837 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181121] TRACE 2019-04-05T15:25:05,840 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181122, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:26 20181122, dir=true] TRACE 2019-04-05T15:25:06,561 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181122] TRACE 2019-04-05T15:25:06,563 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181123, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:27 20181123, dir=true] TRACE 2019-04-05T15:25:07,258 
> [org.apache.camel.component.file.remote.SftpConsumer] - Polling sub 
> directory: /20181123 from: 
> sftp://:22051?connectTimeout=9&disconnect=true&filterDirectory=%24%7Bfile%3Aname%7D+starts+with+%27%24%7Bbean%3AdateofExchange%3Fmethod%3DforLoc%28%22MY%22%29%7D%27&flatten=true&include=.*IMG&knownHostsFile=C%3A%5Cprogram+files%5Cascertain%5CI2R-MystiQ-Engine%5Cknown_hosts&noop=true&password=xx&preferredAuthentications=password&reconnectDelay=3&recursive=true&scheduler=quartz2&scheduler.cron=0+0%2F5+*+*+*+%3F&stepwise=false&username=_ftpuser
>  TRACE 2019-04-05T15:25:07,260 
> [org.apache.camel.component.file.remote.SftpConsumer] - doPollDirectory fro

[jira] [Commented] (CAMEL-13400) Camel FTP Cannot list directory with 'File not found' prepending additional '/' in front of directory automatically

2019-04-09 Thread Claus Ibsen (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-13400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16813115#comment-16813115
 ] 

Claus Ibsen commented on CAMEL-13400:
-

This was first debated on SO which the user should have reported in this JIRA 
so others can see that we have talked about it there first:
https://stackoverflow.com/questions/55570093/camel-ftp-cannot-list-directory-with-file-not-found-pre-pending-additional

I think it smells like a little bug, and a potential fix is to check if that 
absolutePath is empty and if so omit appending the slash.

> Camel FTP Cannot list directory with 'File not found' prepending additional 
> '/' in front of directory automatically
> ---
>
> Key: CAMEL-13400
> URL: https://issues.apache.org/jira/browse/CAMEL-13400
> Project: Camel
>  Issue Type: Bug
>  Components: camel-ftp
>Affects Versions: 3.0.0-M1
>Reporter: Vidhya Sagar Jeevendran
>Priority: Major
>
> I need to poll files form a dynamic folder based on a specific date, so I 
> have provided the parent directory in endpoint URI, enabled recursive flag 
> and add filterDirectory accordingly. But It is not able to poll from the 
> directory, it says file not found for that directory. It is trying with an 
> addition '/' while listing {{listFor(/)}}
> *Endpoint URI*
> {{sftp://:22051?connectTimeout=9&disconnect=true&filterDirectory=%24%7Bfile%3Aname%7D+starts+with+%27%24%7Bbean%3AdateofExchange%3Fmethod%3DforLoc%28%22MY%22%29%7D%27&flatten=true&include=.*IMG&knownHostsFile=C%3A%5Cprogram+files%5Cascertain%5CI2R-MystiQ-Engine%5Cknown_hosts&noop=true&password=xx&preferredAuthentications=password&reconnectDelay=3&recursive=true&scheduler=quartz2&scheduler.cron=0+0%2F5+*+*+*+%3F&stepwise=false&username=_ftpuser
>  }}
> *TRACE LOG*
> {{TRACE 2019-04-05T15:25:03,389 
> [org.apache.camel.component.file.remote.SftpConsumer] - Polling directory: 
> TRACE 2019-04-05T15:25:03,389 
> [org.apache.camel.component.file.remote.SftpOperations] - listFiles() TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - Found 12 in directory: TRACE 2019-04-05T15:25:03,712 
> [org.apache.camel.component.file.remote.SftpConsumer] - SftpFile[fileName=., 
> longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 05:27 ., dir=true] TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - File did not match. Will skip this file: RemoteFile[.] TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - SftpFile[fileName=.., longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 03:04 .., dir=true] TRACE 2019-04-05T15:25:03,712 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[..] TRACE 2019-04-05T15:25:03,728 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20170526, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 02:16 20170526, dir=true] TRACE 2019-04-05T15:25:04,413 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20170526] TRACE 2019-04-05T15:25:04,413 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181119, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:24 20181119, dir=true] TRACE 2019-04-05T15:25:05,117 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181119] TRACE 2019-04-05T15:25:05,117 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181121, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:25 20181121, dir=true] TRACE 2019-04-05T15:25:05,837 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181121] TRACE 2019-04-05T15:25:05,840 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181122, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:26 20181122, dir=true] TRACE 2019-04-05T15:25:06,561 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181122] TRACE 2019-04-05T15:25:06,563 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181123, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:27 20181123, dir=true] TRACE 2019-04-05T15:25:07,258 
> [org.apache.camel.component.file.remote.SftpConsumer] - Polling sub 
> directory: /20181123 from: 
> sftp://:22051?connectTimeout=9&disconnect=true&filterDirectory=%24%7Bfile%3Aname%7D+starts+with+%27%24%7Bbean%3AdateofExchange%3Fmethod%3DforLoc%28%22MY%22%29%7D%27&flatten=true&include=.*IMG&k

[jira] [Commented] (CAMEL-13400) Camel FTP Cannot list directory with 'File not found' prepending additional '/' in front of directory automatically

2019-04-09 Thread Andrea Cosentino (JIRA)


[ 
https://issues.apache.org/jira/browse/CAMEL-13400?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16813097#comment-16813097
 ] 

Andrea Cosentino commented on CAMEL-13400:
--

ask on the user mailing list first

> Camel FTP Cannot list directory with 'File not found' prepending additional 
> '/' in front of directory automatically
> ---
>
> Key: CAMEL-13400
> URL: https://issues.apache.org/jira/browse/CAMEL-13400
> Project: Camel
>  Issue Type: Bug
>  Components: camel-ftp
>Affects Versions: 3.0.0-M1
>Reporter: Vidhya Sagar Jeevendran
>Priority: Major
>
> I need to poll files form a dynamic folder based on a specific date, so I 
> have provided the parent directory in endpoint URI, enabled recursive flag 
> and add filterDirectory accordingly. But It is not able to poll from the 
> directory, it says file not found for that directory. It is trying with an 
> addition '/' while listing {{listFor(/)}}
> *Endpoint URI*
> {{sftp://:22051?connectTimeout=9&disconnect=true&filterDirectory=%24%7Bfile%3Aname%7D+starts+with+%27%24%7Bbean%3AdateofExchange%3Fmethod%3DforLoc%28%22MY%22%29%7D%27&flatten=true&include=.*IMG&knownHostsFile=C%3A%5Cprogram+files%5Cascertain%5CI2R-MystiQ-Engine%5Cknown_hosts&noop=true&password=xx&preferredAuthentications=password&reconnectDelay=3&recursive=true&scheduler=quartz2&scheduler.cron=0+0%2F5+*+*+*+%3F&stepwise=false&username=_ftpuser
>  }}
> *TRACE LOG*
> {{TRACE 2019-04-05T15:25:03,389 
> [org.apache.camel.component.file.remote.SftpConsumer] - Polling directory: 
> TRACE 2019-04-05T15:25:03,389 
> [org.apache.camel.component.file.remote.SftpOperations] - listFiles() TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - Found 12 in directory: TRACE 2019-04-05T15:25:03,712 
> [org.apache.camel.component.file.remote.SftpConsumer] - SftpFile[fileName=., 
> longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 05:27 ., dir=true] TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - File did not match. Will skip this file: RemoteFile[.] TRACE 
> 2019-04-05T15:25:03,712 [org.apache.camel.component.file.remote.SftpConsumer] 
> - SftpFile[fileName=.., longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 03:04 .., dir=true] TRACE 2019-04-05T15:25:03,712 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[..] TRACE 2019-04-05T15:25:03,728 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20170526, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 02:16 20170526, dir=true] TRACE 2019-04-05T15:25:04,413 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20170526] TRACE 2019-04-05T15:25:04,413 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181119, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:24 20181119, dir=true] TRACE 2019-04-05T15:25:05,117 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181119] TRACE 2019-04-05T15:25:05,117 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181121, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:25 20181121, dir=true] TRACE 2019-04-05T15:25:05,837 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181121] TRACE 2019-04-05T15:25:05,840 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181122, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:26 20181122, dir=true] TRACE 2019-04-05T15:25:06,561 
> [org.apache.camel.component.file.remote.SftpConsumer] - File did not match. 
> Will skip this file: RemoteFile[20181122] TRACE 2019-04-05T15:25:06,563 
> [org.apache.camel.component.file.remote.SftpConsumer] - 
> SftpFile[fileName=20181123, longName=dr-x-- 2 ftpadmin ftpadmin 0 Mar 12 
> 05:27 20181123, dir=true] TRACE 2019-04-05T15:25:07,258 
> [org.apache.camel.component.file.remote.SftpConsumer] - Polling sub 
> directory: /20181123 from: 
> sftp://:22051?connectTimeout=9&disconnect=true&filterDirectory=%24%7Bfile%3Aname%7D+starts+with+%27%24%7Bbean%3AdateofExchange%3Fmethod%3DforLoc%28%22MY%22%29%7D%27&flatten=true&include=.*IMG&knownHostsFile=C%3A%5Cprogram+files%5Cascertain%5CI2R-MystiQ-Engine%5Cknown_hosts&noop=true&password=xx&preferredAuthentications=password&reconnectDelay=3&recursive=true&scheduler=quartz2&scheduler.cron=0+0%2F5+*+*+*+%3F&stepwise=false&username=_ftpuser
>  TRACE 2019-04-05T15:25:07,260 
> [org.apache.camel.component.file.remote.SftpConsum