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 */ 017package org.apache.commons.io.filefilter; 018 019import java.io.File; 020import java.io.FileFilter; 021import java.io.FilenameFilter; 022 023/** 024 * An interface which brings the FileFilter and FilenameFilter 025 * interfaces together. 026 * 027 * @since 1.0 028 * 029 */ 030public interface IOFileFilter extends FileFilter, FilenameFilter { 031 032 /** 033 * An empty String array. 034 */ 035 String[] EMPTY_STRING_ARRAY = new String[0]; 036 037 /** 038 * Checks to see if the File should be accepted by this filter. 039 * <p> 040 * Defined in {@link java.io.FileFilter}. 041 * 042 * @param file the File to check 043 * @return true if this file matches the test 044 */ 045 @Override 046 boolean accept(File file); 047 048 /** 049 * Checks to see if the File should be accepted by this filter. 050 * <p> 051 * Defined in {@link java.io.FilenameFilter}. 052 * 053 * @param dir the directory File to check 054 * @param name the file name within the directory to check 055 * @return true if this file matches the test 056 */ 057 @Override 058 boolean accept(File dir, String name); 059 060}