SkidCore/src/org/apache/commons/io/filefilter/FileFilterUtils.java
/**
     * <p>
     * Applies an {@link IOFileFilter} to the provided {@link File} 
     * objects and appends the accepted files to the other supplied collection. 
     * </p>
     * 
     * <pre>
     * List&lt;File&gt; files = ...
     * List&lt;File&gt; directories = FileFilterUtils.filterList(files,
     *     FileFilterUtils.sizeFileFilter(FileUtils.FIFTY_MB), 
     *         new ArrayList&lt;File&gt;());
     * </pre>
     * @param filter the filter to apply to the collection of files.
     * @param files the collection of files to apply the filter to.
     * @param acceptedFiles the list of files to add accepted files to.
     * 
     * @param <T> the type of the file collection.
     * @return a subset of <code>files</code> that is accepted by the 
     *         file filter.
     * @throws IllegalArgumentException if the filter is {@code null} 
     *         or <code>files</code> contains a {@code null} value. 
     */

Applies an  IOFileFilter to the provided  File
objects and appends the accepted files to the other supplied collection.


List<File> files =
List<File> directories = FileFilterUtils.filterList(files,
FileFilterUtils.sizeFileFilter(FileUtils.FIFTY_MB),
new ArrayList<File>());

@param filter the filter to apply to the collection of files.
@param files the collection of files to apply the filter to.
@param acceptedFiles the list of files to add accepted files to.

@param  the type of the file collection.
@return a subset of files that is accepted by the
file filter.
@throws IllegalArgumentException if the filter is  null
or files contains a  null value.
Applies an IOFileFilter to the provided File objects and appends the accepted files to the other supplied collection . List<File > files = List<File > directories = FileFilterUtils . filterList ( files FileFilterUtils . sizeFileFilter ( FileUtils . FIFTY_MB ) new ArrayList<File > () ) ; @param filter the filter to apply to the collection of files . @param files the collection of files to apply the filter to . @param acceptedFiles the list of files to add accepted files to . @param the type of the file collection . @return a subset of files that is accepted by the file filter . @throws IllegalArgumentException if the filter is null or files contains a null value .
private static <T extends Collection<File>> T filter(IOFileFilter filter,
            Iterable<File> files, T acceptedFiles) {
        if (filter == null) {
            throw new IllegalArgumentException("file filter is null");
        }
        if (files != null) {
            for (File file : files) {
                if (file == null) {
                    throw new IllegalArgumentException("file collection contains null");
                }
                if (filter.accept(file)) {
                    acceptedFiles.add(file);
                }
            }
        }
        return acceptedFiles;
    }
private static < T extends Collection < File > > T filter ( IOFileFilter filter , Iterable < File > files , T acceptedFiles ) { if ( filter == null ) { throw new IllegalArgumentException ( "file filter is null" ) ; } if ( files != null ) { for ( File file : files ) { if ( file == null ) { throw new IllegalArgumentException ( "file collection contains null" ) ; } if ( filter . accept ( file ) ) { acceptedFiles . add ( file ) ; } } } return acceptedFiles ; }
<p>
 Applies an {@link IOFileFilter} to the provided {@link File}
 objects and appends the accepted files to the other supplied collection.
<p > Applies an { @link IOFileFilter } to the provided { @link File } objects and appends the accepted files to the other supplied collection .