001    /*
002     * Licensed to the Apache Software Foundation (ASF) under one or more
003     * contributor license agreements.  See the NOTICE file distributed with
004     * this work for additional information regarding copyright ownership.
005     * The ASF licenses this file to You under the Apache License, Version 2.0
006     * (the "License"); you may not use this file except in compliance with
007     * the License.  You may obtain a copy of the License at
008     * 
009     *      http://www.apache.org/licenses/LICENSE-2.0
010     * 
011     * Unless required by applicable law or agreed to in writing, software
012     * distributed under the License is distributed on an "AS IS" BASIS,
013     * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014     * See the License for the specific language governing permissions and
015     * limitations under the License.
016     */
017    package org.apache.commons.io.filefilter;
018    
019    import java.io.File;
020    import java.io.FileFilter;
021    import java.io.FilenameFilter;
022    
023    /**
024     * An interface which brings the FileFilter and FilenameFilter 
025     * interfaces together.
026     * 
027     * @since 1.0
028     * @version $Id: IOFileFilter.java 1304052 2012-03-22 20:55:29Z ggregory $
029     */
030    public interface IOFileFilter extends FileFilter, FilenameFilter {
031    
032        /**
033         * Checks to see if the File should be accepted by this filter.
034         * <p>
035         * Defined in {@link java.io.FileFilter}.
036         * 
037         * @param file  the File to check
038         * @return true if this file matches the test
039         */
040        boolean accept(File file);
041    
042        /**
043         * Checks to see if the File should be accepted by this filter.
044         * <p>
045         * Defined in {@link java.io.FilenameFilter}.
046         * 
047         * @param dir  the directory File to check
048         * @param name  the filename within the directory to check
049         * @return true if this file matches the test
050         */
051        boolean accept(File dir, String name);
052        
053    }