diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/FileTransferringMessageHandlerSpec.java b/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/FileTransferringMessageHandlerSpec.java index 4a12209cb2..a0b0d0e8c2 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/FileTransferringMessageHandlerSpec.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/dsl/FileTransferringMessageHandlerSpec.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2023 the original author or authors. + * Copyright 2016-2024 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import java.util.Collections; import java.util.Map; import java.util.function.Function; +import org.springframework.expression.Expression; import org.springframework.expression.common.LiteralExpression; import org.springframework.integration.dsl.ComponentsRegistration; import org.springframework.integration.dsl.MessageHandlerSpec; @@ -100,8 +101,7 @@ public abstract class FileTransferringMessageHandlerSpec S remoteDirectory(Function, String> remoteDirectoryFunction) { - this.target.setRemoteDirectoryExpression(new FunctionExpression<>(remoteDirectoryFunction)); + return remoteDirectoryExpression(new FunctionExpression<>(remoteDirectoryFunction)); + } + + /** + * Specify a remote directory path SpEL expression. + * @param remoteDirectoryExpression the remote directory expression + * @return the current Spec + * @since 6.3 + */ + public S remoteDirectoryExpression(Expression remoteDirectoryExpression) { + this.target.setRemoteDirectoryExpression(remoteDirectoryExpression); return _this(); } @@ -131,8 +140,7 @@ public abstract class FileTransferringMessageHandlerSpec S temporaryRemoteDirectory(Function, String> temporaryRemoteDirectoryFunction) { - this.target.setTemporaryRemoteDirectoryExpression(new FunctionExpression<>(temporaryRemoteDirectoryFunction)); + return temporaryRemoteDirectoryExpression(new FunctionExpression<>(temporaryRemoteDirectoryFunction)); + } + + /** + * Specify a remote directory path SpEL expression. + * @param temporaryRemoteDirectoryExpression the temporary remote directory path SpEL expression + * @return the current Spec + * @since 6.3 + */ + public S temporaryRemoteDirectoryExpression(Expression temporaryRemoteDirectoryExpression) { + this.target.setTemporaryRemoteDirectoryExpression(temporaryRemoteDirectoryExpression); return _this(); } @@ -198,9 +215,9 @@ public abstract class FileTransferringMessageHandlerSpec