Why is not possible use FileExistsMode in case of mv operation? Is FAIL default value for mv operation?
AbstractRemoteFileOutboundGateway.Command.MV
.fileExistsMode(FileExistsMode.REPLACE)
Why not in MV case? Maybe pull request in next ver?
Why is not possible use FileExistsMode in case of mv operation? Is FAIL default value for mv operation?
AbstractRemoteFileOutboundGateway.Command.MV
.fileExistsMode(FileExistsMode.REPLACE)
Why not in MV case? Maybe pull request in next ver?
The logic there in the
SftpSession
is like this:So, it is always override existing file.
You may consider to use
SftpFileTemplate.exists()
before sending an MV command.We indeed may consider to improve
AbstractRemoteFileOutboundGateway.mv()
logic to use providedFileExistsMode
. Feel free to raise a GH issue and contribute such a feature.