KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sourceforge > importscrubber > JavaFileFilter


1 package net.sourceforge.importscrubber;
2
3 import java.io.File JavaDoc;
4 import java.io.FilenameFilter JavaDoc;
5
6 /**
7  * Encapsulates a file filter which accepts directories and (Java source file names only when there is a class file in the same directory).
8  */

9 public class JavaFileFilter implements FilenameFilter JavaDoc
10 {
11     public boolean accept(File JavaDoc dir, String JavaDoc name)
12     {
13         File JavaDoc file = new File JavaDoc(dir + ImportScrubber.FILE_SEPARATOR + name);
14         if (file.isDirectory() || name.endsWith(".java")) {
15             return true;
16         }
17         return false;
18     }
19 }
20
Popular Tags