camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [1/2] camel git commit: CAMEL-9670 - Camel-ftp: No error message on invalid credentials, thanks to Dirk Reske for the patch
Date Fri, 04 Mar 2016 10:41:39 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.16.x 8f11babb7 -> 9a000e8b7


CAMEL-9670 - Camel-ftp: No error message on invalid credentials, thanks to Dirk Reske for
the patch


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/7b350193
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/7b350193
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/7b350193

Branch: refs/heads/camel-2.16.x
Commit: 7b350193c448b0fbe532947ad746fa6614f5063c
Parents: 8f11bab
Author: Andrea Cosentino <ancosen@gmail.com>
Authored: Fri Mar 4 11:33:52 2016 +0100
Committer: Andrea Cosentino <ancosen@gmail.com>
Committed: Fri Mar 4 11:39:57 2016 +0100

----------------------------------------------------------------------
 .../org/apache/camel/component/file/remote/FtpOperations.java  | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/7b350193/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
----------------------------------------------------------------------
diff --git a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
index 0528362..8621046 100644
--- a/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
+++ b/components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/FtpOperations.java
@@ -175,9 +175,13 @@ public class FtpOperations implements RemoteFileOperations<FTPFile>
{
             }
             log.trace("User {} logged in: {}", username != null ? username : "anonymous",
login);
             if (!login) {
+                // store replyString, because disconnect() will reset ist
+                String replyString = client.getReplyString();
+                int replyCode = client.getReplyCode();
+
                 // disconnect to prevent connection leaks
                 client.disconnect();
-                throw new GenericFileOperationFailedException(client.getReplyCode(), client.getReplyString());
+                throw new GenericFileOperationFailedException(replyCode, replyString);
             }
             client.setFileType(configuration.isBinary() ? FTP.BINARY_FILE_TYPE : FTP.ASCII_FILE_TYPE);
         } catch (IOException e) {


Mime
View raw message