CAMEL-9277: Ftp consumer should log a WARN if auto create directory failed, as we want the consumer to start so the CamelContext can startup.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7bc0f136 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7bc0f136 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7bc0f136 Branch: refs/heads/camel-2.16.x Commit: 7bc0f13691c723403de4f4b5ca17a9ec8fa33c30 Parents: 2427011 Author: Claus Ibsen <davscl...@apache.org> Authored: Sun Nov 22 16:08:49 2015 +0100 Committer: Claus Ibsen <davscl...@apache.org> Committed: Sun Nov 22 16:09:07 2015 +0100 ---------------------------------------------------------------------- .../org/apache/camel/component/file/remote/FtpConsumer.java | 8 ++++---- .../org/apache/camel/component/file/remote/SftpConsumer.java | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/7bc0f136/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java ---------------------------------------------------------------------- diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java index 110a30f..820fc28 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpConsumer.java @@ -48,14 +48,14 @@ public class FtpConsumer extends RemoteFileConsumer<FTPFile> { try { super.doStart(); if (endpoint.isAutoCreate()) { - log.debug("Auto creating \"" + endpoint.getConfiguration().getDirectory()); + log.debug("Auto creating directory: {}", endpoint.getConfiguration().getDirectory()); try { connectIfNecessary(); operations.buildDirectory(endpoint.getConfiguration().getDirectory(), true); } catch (GenericFileOperationFailedException e) { - if (getEndpoint().getConfiguration().isThrowExceptionOnConnectFailed()) { - throw e; - } + // log a WARN as we want to start the consumer. + log.warn("Error auto creating directory: " + endpoint.getConfiguration().getDirectory() + + " due " + e.getMessage() + ". This exception is ignored.", e); } } } finally { http://git-wip-us.apache.org/repos/asf/camel/blob/7bc0f136/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java ---------------------------------------------------------------------- diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java index 0c269fc..4be7394 100644 --- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java +++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpConsumer.java @@ -47,14 +47,14 @@ public class SftpConsumer extends RemoteFileConsumer<ChannelSftp.LsEntry> { try { super.doStart(); if (endpoint.isAutoCreate()) { - log.debug("Auto creating \"" + endpoint.getConfiguration().getDirectory()); + log.debug("Auto creating directory: {}", endpoint.getConfiguration().getDirectory()); try { connectIfNecessary(); operations.buildDirectory(endpoint.getConfiguration().getDirectory(), true); } catch (GenericFileOperationFailedException e) { - if (getEndpoint().getConfiguration().isThrowExceptionOnConnectFailed()) { - throw e; - } + // log a WARN as we want to start the consumer. + log.warn("Error auto creating directory: " + endpoint.getConfiguration().getDirectory() + + " due " + e.getMessage() + ". This exception is ignored.", e); } } } finally {