(S)FTP Lambdas

AMQP Lambdas

Event Lambdas

Feed/File Lambdas

Gemfile/Groovy Lambdas

* Ensure that JavaDocs are checked via `	check.dependsOn javadoc`
* Add `@return` tag to the `MessageBuilder.readOnlyHeaders()`
This commit is contained in:
Gary Russell
2016-09-22 12:32:47 -04:00
committed by Artem Bilan
parent 3402a86fb5
commit e5ae7d886d
48 changed files with 569 additions and 1148 deletions

View File

@@ -80,33 +80,28 @@ public class FtpRemoteFileTemplate extends RemoteFileTemplate<FTPFile> {
*/
@Override
public boolean exists(final String path) {
return doExecuteWithClient(new ClientCallback<FTPClient, Boolean>() {
return doExecuteWithClient(client -> {
try {
switch (FtpRemoteFileTemplate.this.existsMode) {
@Override
public Boolean doWithClient(FTPClient client) {
try {
switch (FtpRemoteFileTemplate.this.existsMode) {
case STAT:
return client.getStatus(path) != null;
case STAT:
return client.getStatus(path) != null;
case NLST:
String[] names = client.listNames(path);
return !ObjectUtils.isEmpty(names);
case NLST:
String[] names = client.listNames(path);
return !ObjectUtils.isEmpty(names);
case NLST_AND_DIRS:
return getSession().exists(path);
case NLST_AND_DIRS:
return getSession().exists(path);
default:
throw new IllegalStateException("Unsupported 'existsMode': " +
FtpRemoteFileTemplate.this.existsMode);
}
}
catch (IOException e) {
throw new MessagingException("Failed to check the remote path for " + path, e);
default:
throw new IllegalStateException("Unsupported 'existsMode': " +
FtpRemoteFileTemplate.this.existsMode);
}
}
catch (IOException e) {
throw new MessagingException("Failed to check the remote path for " + path, e);
}
});
}