INT-1742 fixed FTP rename functionality which does not play well with some of the FTP servers when rename-to file exists
This commit is contained in:
@@ -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 +
|
||||
|
||||
Reference in New Issue
Block a user