You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2017/12/18 13:37:40 UTC

[camel] 02/02: CAMEL-11792: File/ftp producer should not do file exists check if the fileExists is TryRename as it state in the docs it does not do any exists check. The FTP producer will then not create a new connection when uploading files to the ftp server.

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.20.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit dff52ec37395a1dad3f9ffb5f5437a69d7694b43
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Mon Dec 18 14:35:56 2017 +0100

    CAMEL-11792: File/ftp producer should not do file exists check if the fileExists is TryRename as it state in the docs it does not do any exists check. The FTP producer will then not create a new connection when uploading files to the ftp server.
---
 .../main/java/org/apache/camel/component/file/GenericFileProducer.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
index d96884b..62d047b 100644
--- a/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
+++ b/camel-core/src/main/java/org/apache/camel/component/file/GenericFileProducer.java
@@ -154,7 +154,7 @@ public class GenericFileProducer<T> extends DefaultProducer {
                 }
 
                 // delete any pre existing temp file
-                if (operations.existsFile(tempTarget)) {
+                if (endpoint.getFileExist() != GenericFileExist.TryRename && operations.existsFile(tempTarget)) {
                     log.trace("Deleting existing temp file: {}", tempTarget);
                     if (!operations.deleteFile(tempTarget)) {
                         throw new GenericFileOperationFailedException("Cannot delete file: " + tempTarget);

-- 
To stop receiving notification emails like this one, please contact
"commits@camel.apache.org" <co...@camel.apache.org>.