[jira] [Comment Edited] (CAMEL-12337) camel-ftp - ignoreFileNotFoundOrPermissionError not work when folder not found

2018-03-12 Thread abccbaandy (JIRA)

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

abccbaandy edited comment on CAMEL-12337 at 3/12/18 1:02 PM:
-

version 
2.20.3-SNAPSHOT

test option
{code:java}
autoCreate=false=true=true
{code}


sftp
{code:java}
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot 
change directory to: notexist
at 
org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:609)
at 
org.apache.camel.component.file.remote.SftpOperations.changeCurrentDirectory(SftpOperations.java:597)
at 
org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:108)
at 
org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:80)
at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:124)
at 
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
at 
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: 2: No such file
at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873)
at com.jcraft.jsch.ChannelSftp._realpath(ChannelSftp.java:2367)
at com.jcraft.jsch.ChannelSftp.cd(ChannelSftp.java:342)
at 
org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:607)
{code}

ftp
{code:java}
org.apache.camel.component.file.GenericFileOperationFailedException: File 
operation failed: 550 The system cannot find the file specified. 
 Cannot change directory to: notexist. Code: 550
at 
org.apache.camel.component.file.remote.FtpOperations.doChangeDirectory(FtpOperations.java:790)
at 
org.apache.camel.component.file.remote.FtpOperations.changeCurrentDirectory(FtpOperations.java:768)
at 
org.apache.camel.component.file.remote.FtpConsumer.doPollDirectory(FtpConsumer.java:112)
at 
org.apache.camel.component.file.remote.FtpConsumer.pollDirectory(FtpConsumer.java:83)
at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:124)
at 
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
at 
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
{code}



was (Author: abccbaandy):
sftp
{code:java}
org.apache.camel.component.file.GenericFileOperationFailedException: Cannot 
change directory to: notexist
at 
org.apache.camel.component.file.remote.SftpOperations.doChangeDirectory(SftpOperations.java:609)
at 
org.apache.camel.component.file.remote.SftpOperations.changeCurrentDirectory(SftpOperations.java:597)
at 
org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:108)
at 
org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:80)
at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:124)
at 
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
at 
org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at 

[jira] [Comment Edited] (CAMEL-12337) camel-ftp - ignoreFileNotFoundOrPermissionError not work when folder not found

2018-03-09 Thread abccbaandy (JIRA)

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

abccbaandy edited comment on CAMEL-12337 at 3/9/18 6:15 PM:


yes and no.

In fact, I need a way to control the exception"s", especially file/directory 
not found.

In my case : there is a feature to poll files from a directory and process 
them, but the directory may not exist at first.

So, it's not error when directory not found in my case, but I still need to 
know if there is 0 file in the directory or the directory not exist.

for ex, my log should looks like :
[0:00] dir not exist
[0:10] dir not exist
[0:20] dir not exist
[0:30] dir not exist
[0:40] 0 files process  <= directory exist, but no file yet !!
[0:50] 2 files process
[1:00] 23 files process
...

Current "file not found" exception is too verbose to me, and I can't format it.
Because of that, my current log looks like :
[0:00] org.apache.camel.component.file.GenericFileOperationFailedException: 
Cannot list directory: notexist
at 
org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:650)
at 
org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:118)
at 
org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:80)
at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:124)
at 
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
[0:10] org.apache.camel.component.file.GenericFileOperationFailedException: 
Cannot list directory: notexist
at 
org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:650)
at 
org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:118)
at 
org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:80)
at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:124)
at 
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
[0:30] org.apache.camel.component.file.GenericFileOperationFailedException: 
Cannot list directory: notexist
at 
org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:650)
at 
org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:118)
at 
org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:80)
at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:124)
at 
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
[0:40] 0 files process  <= directory exist, but no file yet !!
[0:50] 2 files process
[1:00] 23 files process


was (Author: abccbaandy):
yes and no.

In fact, I need a way to control the exception"s", especially file/directory 
not found.

In my case : there is a feature to poll files from a directory and process 
them, but the directory may not exist at first.

So, it's not error when directory not found, but I still need to know if there 
is 0 file in the directory or the directory not exist.

for ex, my log may looks like :
[0:00] dir not exist
[0:10] dir not exist
[0:20] dir not exist
[0:30] dir not exist
[0:40] 0 files process  <= directory exist, but no file yet !!
[0:50] 2 files process
[1:00] 23 files process
...

Current "file not found" exception is too verbose to me, and I can't format it.
Because of that, my current log looks like :
[0:00] org.apache.camel.component.file.GenericFileOperationFailedException: 
Cannot list directory: notexist
at 
org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:650)
at 
org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:118)
at 
org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:80)
at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:124)
at 
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
[0:10] org.apache.camel.component.file.GenericFileOperationFailedException: 
Cannot list directory: notexist
at 
org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:650)
at 
org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:118)
at 
org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:80)
at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:124)
at 
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
[0:30] org.apache.camel.component.file.GenericFileOperationFailedException: 
Cannot 

[jira] [Comment Edited] (CAMEL-12337) camel-ftp - ignoreFileNotFoundOrPermissionError not work when folder not found

2018-03-09 Thread abccbaandy (JIRA)

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

abccbaandy edited comment on CAMEL-12337 at 3/9/18 6:14 PM:


yes and no.

In fact, I need a way to control the exception"s", especially file/directory 
not found.

In my case : there is a feature to poll files from a directory and process 
them, but the directory may not exist at first.

So, it's not error when directory not found, but I still need to know if there 
is 0 file in the directory or the directory not exist.

for ex, my log may looks like :
[0:00] dir not exist
[0:10] dir not exist
[0:20] dir not exist
[0:30] dir not exist
[0:40] 0 files process  <= directory exist, but no file yet !!
[0:50] 2 files process
[1:00] 23 files process
...

Current "file not found" exception is too verbose to me, and I can't format it.
Because of that, my current log looks like :
[0:00] org.apache.camel.component.file.GenericFileOperationFailedException: 
Cannot list directory: notexist
at 
org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:650)
at 
org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:118)
at 
org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:80)
at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:124)
at 
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
[0:10] org.apache.camel.component.file.GenericFileOperationFailedException: 
Cannot list directory: notexist
at 
org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:650)
at 
org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:118)
at 
org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:80)
at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:124)
at 
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
[0:30] org.apache.camel.component.file.GenericFileOperationFailedException: 
Cannot list directory: notexist
at 
org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:650)
at 
org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:118)
at 
org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:80)
at 
org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:124)
at 
org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
[0:40] 0 files process  <= directory exist, but no file yet !!
[0:50] 2 files process
[1:00] 23 files process


was (Author: abccbaandy):
yes and no.

In fact, I need a way to control the exception"s", especially file/directory 
not found.

In my case, it's not error when directory not found, but I still need to know 
if there is 0 file in the directory or the directory not exist.

for ex:
mylog.log
[0:00] dir not exist
[0:10] dir not exist
[0:20] dir not exist
[0:30] dir not exist
[0:40] 0 files process  <= directory exist, but no file yet !!
[0:50] 2 files process
[1:00] 23 files process
...

Current "file not found" exception is too verbose to me, and I can't format it.

> camel-ftp - ignoreFileNotFoundOrPermissionError not work when folder not found
> --
>
> Key: CAMEL-12337
> URL: https://issues.apache.org/jira/browse/CAMEL-12337
> Project: Camel
>  Issue Type: Improvement
>  Components: camel-ftp, camel-sftp
>Affects Versions: 2.20.2
>Reporter: abccbaandy
>Priority: Minor
>
> I tried something like these code, but when "notexist" folder not exist, it 
> still give me exception
> {code:java}
> sftp://testserver:22/notexist?autoCreate=false=true
> {code}
> {code:java}
> org.apache.camel.component.file.GenericFileOperationFailedException: Cannot 
> list directory: notexist
>   at 
> org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:650)
>   at 
> org.apache.camel.component.file.remote.SftpConsumer.doPollDirectory(SftpConsumer.java:118)
>   at 
> org.apache.camel.component.file.remote.SftpConsumer.pollDirectory(SftpConsumer.java:80)
>   at 
> org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:124)
>   at 
> org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:174)
>   at 
> org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:101)
>   at 
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
>   at