KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jodd > io > filter > WildcardFileFilter


1 // Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.
2

3 package jodd.io.filter;
4
5 import java.io.File JavaDoc;
6
7 import jodd.util.Wildcard;
8
9 /**
10  * FileFilter that matches file names against wildcard pattern (* and ?).
11  */

12 public class WildcardFileFilter extends FileFilterBase {
13
14     private String JavaDoc pattern;
15
16     /**
17      * Wildcard file filter.
18      */

19     public WildcardFileFilter(String JavaDoc pattern) {
20         this.pattern = pattern;
21     }
22
23     public boolean accept(File JavaDoc dir, String JavaDoc name) {
24         return Wildcard.match(name, pattern);
25     }
26 }
27
28
Popular Tags