Repository: camel Updated Branches: refs/heads/master 8bcbd5b03 -> 45475b357
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/4677897e Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/4677897e Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/4677897e Branch: refs/heads/master Commit: 4677897e82abed1ae0211ae873d95b6365edb50e Parents: 8bcbd5b Author: Andrea Cosentino <anco...@gmail.com> Authored: Fri Mar 4 11:33:52 2016 +0100 Committer: Andrea Cosentino <anco...@gmail.com> Committed: Fri Mar 4 11:33:52 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/4677897e/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) {