From issues-return-50098-archive-asf-public=cust-asf.ponee.io@camel.apache.org Fri Mar 9 17:50:06 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id D56FB18064A for ; Fri, 9 Mar 2018 17:50:05 +0100 (CET) Received: (qmail 69092 invoked by uid 500); 9 Mar 2018 16:50:04 -0000 Mailing-List: contact issues-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list issues@camel.apache.org Received: (qmail 69083 invoked by uid 99); 9 Mar 2018 16:50:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Mar 2018 16:50:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 73987180111 for ; Fri, 9 Mar 2018 16:50:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -109.511 X-Spam-Level: X-Spam-Status: No, score=-109.511 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id 9n6NHqOwoOj1 for ; Fri, 9 Mar 2018 16:50:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id B0EEC5F5B0 for ; Fri, 9 Mar 2018 16:50:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id A23D0E0969 for ; Fri, 9 Mar 2018 16:50:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 4B56B2143B for ; Fri, 9 Mar 2018 16:50:00 +0000 (UTC) Date: Fri, 9 Mar 2018 16:50:00 +0000 (UTC) From: "abccbaandy (JIRA)" To: issues@camel.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CAMEL-12337) camel-ftp - ignoreFileNotFoundOrPermissionError not work when folder not found MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CAMEL-12337?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16393152#comment-16393152 ] abccbaandy commented on CAMEL-12337: ------------------------------------ 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&ignoreFileNotFoundOrPermissionError=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 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: com.jcraft.jsch.SftpException: No such file > at com.jcraft.jsch.ChannelSftp.throwStatusError(ChannelSftp.java:2873) > at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2225) > at com.jcraft.jsch.ChannelSftp._stat(ChannelSftp.java:2242) > at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1592) > at com.jcraft.jsch.ChannelSftp.ls(ChannelSftp.java:1553) > at org.apache.camel.component.file.remote.SftpOperations.listFiles(SftpOperations.java:641) > ... 12 common frames omitted > {code} > ftp has the same issue. > {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} -- This message was sent by Atlassian JIRA (v7.6.3#76005)