Restore FileListFilter and fix some javadoc links.

This commit is contained in:
Iwein Fuld
2010-10-15 10:33:28 +02:00
parent 037d2113f8
commit 15a5eaf265
4 changed files with 58 additions and 10 deletions

View File

@@ -33,6 +33,9 @@ import java.util.List;
public abstract class AbstractEntryListFilter<T> implements InitializingBean, EntryListFilter<T> {
public abstract boolean accept(T t);
/**
* {@inheritDoc}
*/
public List<T> filterEntries(T[] entries) {
List<T> accepted = new ArrayList<T>();

View File

@@ -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.
* <p/>
* {@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}.
* <p/>
* 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<T> {
/**
* Filters out entries and returns the entries that are left in a list, or an
* empty list when a null is passed in.
*/
List<T> filterEntries(T[] entries);
}

View File

@@ -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 <T> the type of entry
*
* @since 2.0.0
*/
public class PatternMatchingEntryListFilter<T> extends AbstractEntryListFilter<T> implements InitializingBean {
private Pattern pattern;

View File

@@ -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<File> filterFiles(File[] files);
}