diff --git a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/FtpSession.java b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/FtpSession.java index a72baaf00a..813cbff4aa 100644 --- a/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/FtpSession.java +++ b/spring-integration-ftp/src/main/java/org/springframework/integration/ftp/session/FtpSession.java @@ -151,12 +151,8 @@ public class FtpSession implements Session { @Override public void close() { try { - if (this.readingRaw.get()) { - if (!finalizeRaw()) { - if (LOGGER.isWarnEnabled()) { - LOGGER.warn("Finalize on readRaw() returned false for " + this); - } - } + if (this.readingRaw.get() && !finalizeRaw() && LOGGER.isWarnEnabled()) { + LOGGER.warn("Finalize on readRaw() returned false for " + this); } this.client.disconnect(); } @@ -181,11 +177,11 @@ public class FtpSession implements Session { this.client.deleteFile(pathTo); boolean completed = this.client.rename(pathFrom, pathTo); if (!completed) { - throw new IOException("Failed to rename '" + pathFrom + - "' to " + pathTo + SERVER_REPLIED_WITH + this.client.getReplyString()); + throw new IOException("Failed to rename " + pathFrom + + " to " + pathTo + SERVER_REPLIED_WITH + this.client.getReplyString()); } if (LOGGER.isInfoEnabled()) { - LOGGER.info("File has been successfully renamed from: " + pathFrom + " to " + pathTo); + LOGGER.info("File has been successfully renamed from " + pathFrom + " to " + pathTo); } }