From 010a323446ff46dc63e471f20fb04965cb45e696 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Wed, 12 Jan 2011 11:32:09 -0500 Subject: [PATCH] INT-1742 fixed FTP rename functionality which does not play well with some of the FTP servers when rename-to file exists --- .../springframework/integration/ftp/session/FtpSession.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 8406fc9dbd..20f4ba0701 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 @@ -79,7 +79,7 @@ class FtpSession implements Session { Assert.hasText(path, "path must not be null"); boolean completed = client.storeFile(path, inputStream); if (!completed){ - throw new IOException("Failed to write to '" + (path+FileWritingMessageHandler.TEMPORARY_FILE_SUFFIX) + throw new IOException("Failed to write to '" + path + "'. Server replied with: " + client.getReplyString()); } logger.info("File have been successfully transfered to: " + path); @@ -106,6 +106,7 @@ class FtpSession implements Session { } public void rename(String pathFrom, String pathTo) throws IOException{ + client.deleteFile(pathTo); boolean completed = client.rename(pathFrom, pathTo); if (!completed){ throw new IOException("Failed to rename '" + pathFrom +