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:43:20 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.15.x a092bb3cb -> 0dd343e9a


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/4dc578ce
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4dc578ce
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4dc578ce

Branch: refs/heads/camel-2.15.x
Commit: 4dc578ce2d7e747c9b694d5e9f4794ac121066d6
Parents: a092bb3
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:42:01 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/4dc578ce/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