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**
This commit is contained in:
Artem Bilan
2017-09-20 16:10:19 -04:00
committed by Gary Russell
parent bc4337ffa8
commit 077b5ffffc
4 changed files with 38 additions and 18 deletions

View File

@@ -102,8 +102,8 @@ public class FtpOutboundGateway extends AbstractRemoteFileOutboundGateway<FTPFil
}
/**
* Construct an instance with the supplied session factory, a command ('ls', 'get'
* etc).
* Construct an instance with the supplied session factory
* and command ('ls', 'nlst', 'put' or 'mput').
* <p> The {@code remoteDirectory} expression is {@code null} assuming to use
* the {@code workingDirectory} from the FTP Client.
* @param sessionFactory the session factory.
@@ -115,8 +115,8 @@ public class FtpOutboundGateway extends AbstractRemoteFileOutboundGateway<FTPFil
}
/**
* Construct an instance with the supplied remote file template, a command ('ls',
* 'get' etc).
* Construct an instance with the supplied remote file template
* and command ('ls', 'nlst', 'put' or 'mput').
* <p> The {@code remoteDirectory} expression is {@code null} assuming to use
* the {@code workingDirectory} from the FTP Client.
* @param remoteFileTemplate the remote file template.