INT-1614 refactoring FTP and SFTP so that base class receive() calls synchronizer on demand for both (was for SFTP but not FTP).
This commit is contained in:
@@ -132,7 +132,7 @@ public abstract class AbstractInboundRemoteFileSystemSychronizer<F> extends Abst
|
||||
/**
|
||||
* This is the callback where we need the implementation to do some specific work
|
||||
*/
|
||||
protected abstract void syncRemoteToLocalFileSystem() throws Exception;
|
||||
protected abstract void syncRemoteToLocalFileSystem();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -148,8 +148,18 @@ public abstract class AbstractInboundRemoteFileSystemSynchronizingMessageSource<
|
||||
}
|
||||
}
|
||||
|
||||
public Message<File> receive() {
|
||||
return this.fileSource.receive();
|
||||
/**
|
||||
* Polls from the file source. If the result is not null, it will be returned.
|
||||
* If the result is null, it attempts to sync up with the remote directory to populate the file source.
|
||||
* Then, it polls the file source again and returns the result, whether or not it is null.
|
||||
*/
|
||||
public final Message<File> receive() {
|
||||
Message<File> message = this.fileSource.receive();
|
||||
if (message == null) {
|
||||
this.synchronizer.syncRemoteToLocalFileSystem();
|
||||
message = this.fileSource.receive();
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
|
||||
Reference in New Issue
Block a user