INT-4344: AbstRemoteFileOutGw: Add assert for NPE

JIRA: https://jira.spring.io/browse/INT-4344

The `FtpOutboundGateway` provides ctors without expression for remote path.
In this case it is treated as a `working directory` but only for the
`LS`, `NLST`, `PUT` and `MPUT` commands.

* Add assertion in the `AbstractRemoteFileOutboundGateway` to discard
configuration for all other commands when `expression` is `null`

**Cherry-pick to 4.3.x**

Conflicts:
	spring-integration-file/src/main/java/org/springframework/integration/file/remote/gateway/AbstractRemoteFileOutboundGateway.java
Resolved.
This commit is contained in:
Artem Bilan
2017-09-20 16:10:19 -04:00
committed by Gary Russell
parent 6ec34c114c
commit 7d24b8ec67
4 changed files with 34 additions and 18 deletions

View File

@@ -684,8 +684,9 @@ directories, which is achievable using the `FileInfo` objects.
Starting with _version 4.3_, the `FtpSession` supports `null` for the `list()` and `listNames()` methods,
therefore the `expression` attribute can be omitted.
From Java perspective there are two new constructor without `expression` argument for convenience.
The `null` for `LS` command is treated as an Client working directory according to the FTP protocol.
For Java configuration, there are two constructors without an `expression` argument for convenience.
`null` for `LS`, `PUT` and `MPUT` commands is treated as the Client working directory according to the FTP protocol.
All other commands must be supplied with the `expression` to evaluate remote path against request message.
The working directory can be set via the `FTPClient.changeWorkingDirectory()` function when you extend the `DefaultFtpSessionFactory` and implement `postProcessClientAfterConnect()` callback.
*get*