List of usage examples for org.springframework.integration.ftp.filters FtpSystemMarkerFilePresentFileListFilter FtpSystemMarkerFilePresentFileListFilter
public FtpSystemMarkerFilePresentFileListFilter(
Map<FileListFilter<FTPFile>, Function<String, String>> filtersAndFunctions)
From source file:org.springframework.integration.ftp.filters.FtpFileListFilterTests.java
@Test public void testMarkerFile() throws Exception { FtpSystemMarkerFilePresentFileListFilter filter = new FtpSystemMarkerFilePresentFileListFilter( new FtpSimplePatternFileListFilter("*.txt")); FTPFile[] files = template.list("ftpSource"); assertThat(files.length, greaterThan(0)); List<FTPFile> filtered = filter.filterFiles(files); assertThat(filtered.size(), equalTo(0)); File remoteDir = getSourceRemoteDirectory(); File marker = new File(remoteDir, "ftpSource2.txt.complete"); marker.createNewFile();/* ww w. j av a2 s. c om*/ files = template.list("ftpSource"); filtered = filter.filterFiles(files); assertThat(filtered.size(), equalTo(1)); assertThat(filtered.get(0).getName(), equalTo("ftpSource2.txt")); marker.delete(); }