INT-1614 FTP inbound synchronizer now requires 'sessionFactory' as a constructor argument like the other adapters
This commit is contained in:
@@ -45,8 +45,8 @@ public abstract class AbstractFtpInboundChannelAdapterParser extends AbstractPol
|
||||
BeanDefinitionBuilder synchronizerBuilder =
|
||||
BeanDefinitionBuilder.genericBeanDefinition("org.springframework.integration.ftp.inbound.FtpInboundFileSynchronizer");
|
||||
|
||||
synchronizerBuilder.addConstructorArgValue(poolBuilder.getBeanDefinition());
|
||||
IntegrationNamespaceUtils.setValueIfAttributeDefined(synchronizerBuilder, element, "remote-directory", "remotePath");
|
||||
synchronizerBuilder.addPropertyValue("sessionFactory", poolBuilder.getBeanDefinition());
|
||||
// IntegrationNamespaceUtils.setValueIfAttributeDefined(synchronizerBuilder, element, "auto-delete-remote-files-on-sync", "shouldDeleteSourceFile");
|
||||
//
|
||||
//
|
||||
|
||||
@@ -48,14 +48,14 @@ public class FtpInboundFileSynchronizer extends AbstractInboundFileSynchronizer<
|
||||
|
||||
|
||||
/**
|
||||
* The {@link org.springframework.integration.ftp.session.FtpClientPool} that holds references to {@link org.apache.commons.net.ftp.FTPClient} instances
|
||||
*
|
||||
* @param clientPool the {@link org.springframework.integration.ftp.session.FtpClientPool}
|
||||
* Create a synchronizer with the {@link SessionFactory} used to acquire {@link Session} instances.
|
||||
*/
|
||||
public void setSessionFactory(SessionFactory sessionFactory) {
|
||||
public FtpInboundFileSynchronizer(SessionFactory sessionFactory) {
|
||||
Assert.notNull(sessionFactory, "sessionFactory must not be null");
|
||||
this.sessionFactory = sessionFactory;
|
||||
}
|
||||
|
||||
|
||||
public void setRemotePath(String remotePath) {
|
||||
this.remotePath = remotePath;
|
||||
}
|
||||
|
||||
@@ -76,8 +76,7 @@ public class FtpInboundRemoteFileSystemSynchronizerTest {
|
||||
FtpInboundFileSynchronizingMessageSource ms =
|
||||
new FtpInboundFileSynchronizingMessageSource();
|
||||
|
||||
FtpInboundFileSynchronizer synchronizer = spy(new FtpInboundFileSynchronizer());
|
||||
synchronizer.setSessionFactory(ftpSessionFactory);
|
||||
FtpInboundFileSynchronizer synchronizer = spy(new FtpInboundFileSynchronizer(ftpSessionFactory));
|
||||
synchronizer.setShouldDeleteSourceFile(true);
|
||||
synchronizer.setRemotePath("remote-test-dir");
|
||||
synchronizer.setFilter(new FtpPatternMatchingFileListFilter(".*\\.test$"));
|
||||
|
||||
Reference in New Issue
Block a user