diff --git a/spring-integration-smb/src/main/resources/org/springframework/integration/smb/config/spring-integration-smb-1.0.xsd b/spring-integration-smb/src/main/resources/org/springframework/integration/smb/config/spring-integration-smb-1.0.xsd index 0aeb4e0..6a37772 100644 --- a/spring-integration-smb/src/main/resources/org/springframework/integration/smb/config/spring-integration-smb-1.0.xsd +++ b/spring-integration-smb/src/main/resources/org/springframework/integration/smb/config/spring-integration-smb-1.0.xsd @@ -193,6 +193,26 @@ + + + + + + + + + Allows you to specify a reference to a + [org.springframework.integration.file.filters.FileListFilter] + bean. This filter is applied to files after they have been + retrieved. The default is an AcceptOnceFileListFilter which means that, + even if a new instance of a file is retrieved from the remote server, + a message won't be generated. The filter provided here is combined + with a filter that prevents the message source from processing + files that are currently being downloaded. + + + diff --git a/spring-integration-smb/src/test/java/org/springframework/integration/smb/config/SmbInboundChannelAdapterParserTests-context.xml b/spring-integration-smb/src/test/java/org/springframework/integration/smb/config/SmbInboundChannelAdapterParserTests-context.xml index c590242..0511337 100644 --- a/spring-integration-smb/src/test/java/org/springframework/integration/smb/config/SmbInboundChannelAdapterParserTests-context.xml +++ b/spring-integration-smb/src/test/java/org/springframework/integration/smb/config/SmbInboundChannelAdapterParserTests-context.xml @@ -1,10 +1,9 @@ + class="org.springframework.integration.smb.config.SmbInboundChannelAdapterParserTests.TestSessionFactoryBean"/> + + + auto-startup="false" + channel="smbChannel" + session-factory="smbSessionFactory" + charset="UTF-8" + auto-create-local-directory="true" + delete-remote-files="true" + filename-pattern="*.txt" + local-filter="acceptAllFilter" + local-directory="file:test-temp/local-1" + remote-file-separator="" + comparator="comparator" + temporary-file-suffix=".working.tmp" + remote-directory="test-temp/remote-1"> @@ -33,21 +36,23 @@ + channel="smbChannel" + auto-startup="false" + session-factory="smbSessionFactory" + charset="UTF-8" + auto-create-local-directory="true" + delete-remote-files="true" + filter="entryListFilter" + local-directory="file:test-temp/local-2" + remote-directory="test-temp/remote-2"> + channel="smbChannel" + auto-startup="false" + session-factory="smbSessionFactory" + local-directory="file:test-temp/local-3" + remote-directory="test-temp/remote-3"> diff --git a/spring-integration-smb/src/test/java/org/springframework/integration/smb/config/SmbInboundChannelAdapterParserTests.java b/spring-integration-smb/src/test/java/org/springframework/integration/smb/config/SmbInboundChannelAdapterParserTests.java index 143c010..d5ac417 100644 --- a/spring-integration-smb/src/test/java/org/springframework/integration/smb/config/SmbInboundChannelAdapterParserTests.java +++ b/spring-integration-smb/src/test/java/org/springframework/integration/smb/config/SmbInboundChannelAdapterParserTests.java @@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import java.util.Collection; import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -69,7 +70,6 @@ public class SmbInboundChannelAdapterParserTests { assertNotNull(queue.comparator()); assertEquals("smbInbound", adapter.getComponentName()); assertEquals("smb:inbound-channel-adapter", adapter.getComponentType()); - assertNotNull(TestUtils.getPropertyValue(adapter, "poller")); assertEquals(applicationContext.getBean("smbChannel"), TestUtils.getPropertyValue(adapter, "outputChannel")); SmbInboundFileSynchronizingMessageSource inbound = (SmbInboundFileSynchronizingMessageSource) TestUtils.getPropertyValue(adapter, "source"); @@ -90,6 +90,10 @@ public class SmbInboundChannelAdapterParserTests { assertThat(filtersIterator.next(), instanceOf(SmbPersistentAcceptOnceFileListFilter.class)); Object sessionFactory = TestUtils.getPropertyValue(fisync, "remoteFileTemplate.sessionFactory"); assertTrue(SmbSessionFactory.class.isAssignableFrom(sessionFactory.getClass())); + + FileListFilter acceptAllFilter = this.applicationContext.getBean("acceptAllFilter", FileListFilter.class); + assertTrue(TestUtils.getPropertyValue(inbound, "fileSource.scanner.filter.fileFilters", Collection.class) + .contains(acceptAllFilter)); } @Test