jaroslav@1258
|
1 |
/*
|
jaroslav@1258
|
2 |
* Copyright (c) 1994, 1998, Oracle and/or its affiliates. All rights reserved.
|
jaroslav@1258
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
jaroslav@1258
|
4 |
*
|
jaroslav@1258
|
5 |
* This code is free software; you can redistribute it and/or modify it
|
jaroslav@1258
|
6 |
* under the terms of the GNU General Public License version 2 only, as
|
jaroslav@1258
|
7 |
* published by the Free Software Foundation. Oracle designates this
|
jaroslav@1258
|
8 |
* particular file as subject to the "Classpath" exception as provided
|
jaroslav@1258
|
9 |
* by Oracle in the LICENSE file that accompanied this code.
|
jaroslav@1258
|
10 |
*
|
jaroslav@1258
|
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
jaroslav@1258
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
jaroslav@1258
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
jaroslav@1258
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that
|
jaroslav@1258
|
15 |
* accompanied this code).
|
jaroslav@1258
|
16 |
*
|
jaroslav@1258
|
17 |
* You should have received a copy of the GNU General Public License version
|
jaroslav@1258
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
jaroslav@1258
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
jaroslav@1258
|
20 |
*
|
jaroslav@1258
|
21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
jaroslav@1258
|
22 |
* or visit www.oracle.com if you need additional information or have any
|
jaroslav@1258
|
23 |
* questions.
|
jaroslav@1258
|
24 |
*/
|
jaroslav@1258
|
25 |
|
jaroslav@1258
|
26 |
package java.io;
|
jaroslav@1258
|
27 |
|
jaroslav@1258
|
28 |
/**
|
jaroslav@1258
|
29 |
* Instances of classes that implement this interface are used to
|
jaroslav@1258
|
30 |
* filter filenames. These instances are used to filter directory
|
jaroslav@1258
|
31 |
* listings in the <code>list</code> method of class
|
jaroslav@1258
|
32 |
* <code>File</code>, and by the Abstract Window Toolkit's file
|
jaroslav@1258
|
33 |
* dialog component.
|
jaroslav@1258
|
34 |
*
|
jaroslav@1258
|
35 |
* @author Arthur van Hoff
|
jaroslav@1258
|
36 |
* @author Jonathan Payne
|
jaroslav@1258
|
37 |
* @see java.awt.FileDialog#setFilenameFilter(java.io.FilenameFilter)
|
jaroslav@1258
|
38 |
* @see java.io.File
|
jaroslav@1258
|
39 |
* @see java.io.File#list(java.io.FilenameFilter)
|
jaroslav@1258
|
40 |
* @since JDK1.0
|
jaroslav@1258
|
41 |
*/
|
jaroslav@1258
|
42 |
public
|
jaroslav@1258
|
43 |
interface FilenameFilter {
|
jaroslav@1258
|
44 |
/**
|
jaroslav@1258
|
45 |
* Tests if a specified file should be included in a file list.
|
jaroslav@1258
|
46 |
*
|
jaroslav@1258
|
47 |
* @param dir the directory in which the file was found.
|
jaroslav@1258
|
48 |
* @param name the name of the file.
|
jaroslav@1258
|
49 |
* @return <code>true</code> if and only if the name should be
|
jaroslav@1258
|
50 |
* included in the file list; <code>false</code> otherwise.
|
jaroslav@1258
|
51 |
*/
|
jaroslav@1258
|
52 |
boolean accept(File dir, String name);
|
jaroslav@1258
|
53 |
}
|