diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/entries/AbstractEntryListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/entries/AbstractEntryListFilter.java index 7de94a91cb..6925a29b7a 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/entries/AbstractEntryListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/entries/AbstractEntryListFilter.java @@ -33,6 +33,9 @@ import java.util.List; public abstract class AbstractEntryListFilter implements InitializingBean, EntryListFilter { public abstract boolean accept(T t); + /** + * {@inheritDoc} + */ public List filterEntries(T[] entries) { List accepted = new ArrayList(); diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/entries/EntryListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/entries/EntryListFilter.java index 20dca2c18d..58d4e0d11f 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/entries/EntryListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/entries/EntryListFilter.java @@ -19,18 +19,23 @@ import java.util.List; /** - * Strategy interface for filtering a group of entries / files. + * Strategy interface for filtering entries representing files on a local or remote file system. This is a generic + * variant of FileListFilter that also works with references to remote files. *

- * {@link EntryListFilter} that passes file entries only one time. This can - * conveniently be used to prevent duplication of files, as is done in - * {@link org.springframework.integration.file.FileReadingMessageSource}. - *

- * This implementation is thread safe. + * Implementations must be thread safe. * - * @author Iwein Fuld * @author Josh Long - * @since 1.0.0 + * @author Iwein Fuld + * + * @since 2.0.0 + * + * @see org.springframework.integration.file.filters.FileListFilter */ public interface EntryListFilter { + + /** + * Filters out entries and returns the entries that are left in a list, or an + * empty list when a null is passed in. + */ List filterEntries(T[] entries); } diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/entries/PatternMatchingEntryListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/entries/PatternMatchingEntryListFilter.java index fe9778f77b..df5df2c3bb 100644 --- a/spring-integration-file/src/main/java/org/springframework/integration/file/entries/PatternMatchingEntryListFilter.java +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/entries/PatternMatchingEntryListFilter.java @@ -23,14 +23,14 @@ import java.util.regex.Pattern; /** - * - * * Filters a listing of entries (T) by qualifying their 'name' (as determined by {@link org.springframework.integration.file.entries.EntryNamer}) * against a regular expression (an instance of {@link java.util.regex.Pattern}) * * @author Iwein Fuld * @author Josh Long * @param the type of entry + * + * @since 2.0.0 */ public class PatternMatchingEntryListFilter extends AbstractEntryListFilter implements InitializingBean { private Pattern pattern; diff --git a/spring-integration-file/src/main/java/org/springframework/integration/file/filters/FileListFilter.java b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/FileListFilter.java new file mode 100644 index 0000000000..65529f4eba --- /dev/null +++ b/spring-integration-file/src/main/java/org/springframework/integration/file/filters/FileListFilter.java @@ -0,0 +1,40 @@ +/* + * Copyright 2002-2008 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.springframework.integration.file.filters; + +import java.io.File; +import java.util.List; + +/** + * Strategy interface for filtering a group of files. + * + * @author Iwein Fuld + * + * @since 1.0.0 + * + * @see org.springframework.integration.file.entries.EntryListFilter + * + */ +public interface FileListFilter { + + /** + * Filters out files and returns the files that are left in a list, or an + * empty list when a null is passed in. + */ + List filterFiles(File[] files); + +}