GH-3026: Fix chmod support for DSL

Fixes https://github.com/spring-projects/spring-integration/issues/3026

**Cherry-pick to `5.1.x`**

* Populate proper `FileTransferringMessageHandler` impl from DSL spec
implementations.
This way we are able to use a provided `chmod` from Java DSL
* Added `FileTransferringMessageHandlerSpec` ctor TODO
* Update SftpTests
* Code cleanup; `@Ignore` `SftpTests.testSftpOutboundFlowWithChmod()`
since it doesn't work properly on Windows
This commit is contained in:
Joaquin Santana
2019-10-15 17:12:24 +02:00
committed by Artem Bilan
parent 66c3eff2ba
commit 7aea76c6c4
6 changed files with 77 additions and 7 deletions

View File

@@ -41,6 +41,7 @@ import org.springframework.util.Assert;
* @param <S> the target {@link FileTransferringMessageHandlerSpec} implementation type.
*
* @author Artem Bilan
* @author Joaquin Santana
*
* @since 5.0
*/
@@ -52,6 +53,10 @@ public abstract class FileTransferringMessageHandlerSpec<F, S extends FileTransf
private DefaultFileNameGenerator defaultFileNameGenerator;
// TODO: should be refactored using generics in next release (breaking change), see PR-3080.
protected FileTransferringMessageHandlerSpec() {
}
protected FileTransferringMessageHandlerSpec(SessionFactory<F> sessionFactory) {
this.target = new FileTransferringMessageHandler<>(sessionFactory);
}
@@ -62,6 +67,7 @@ public abstract class FileTransferringMessageHandlerSpec<F, S extends FileTransf
protected FileTransferringMessageHandlerSpec(RemoteFileTemplate<F> remoteFileTemplate,
FileExistsMode fileExistsMode) {
this.target = new FileTransferringMessageHandler<>(remoteFileTemplate, fileExistsMode);
}