Clover coverage report - PMD - 3.9 Coverage timestamp: Tue Dec 19 2006 09:38:44 EST FRAMES NO FRAMES |
file stats: | LOC: | 33 |  | Methods: | 2
| NCLOC: | 13 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
SourceFileOrDirectoryFilter.java | - | 0% | 0% | 0% |

1 |  | /**
2 |  | *
3 |  | */
4 |  | package net.sourceforge.pmd.cpd;
5 |  |
6 |  | import net.sourceforge.pmd.SourceFileSelector;
7 |  |
8 |  | import java.io.File;
9 |  | import java.io.FilenameFilter;
10 |  |
11 |  | /**
12 |  | * Filtering of directories en wanted source files.
13 |  | */
14 |  | public class SourceFileOrDirectoryFilter implements FilenameFilter {
15 |  |
16 |  | private SourceFileSelector fileSelector;
17 |  |
18 |  | private static final String fileSeparator = System.getProperty("file.separator");
19 |  |
20 |  | /**
21 |  | * Public constructor
22 |  | *
23 |  | * @param fileSelector the FileSelector that knows what source files to accept
24 |  | */
25 | 0 | public SourceFileOrDirectoryFilter(SourceFileSelector fileSelector) {
26 | 0 | this.fileSelector = fileSelector;
27 |  | }
28 |  |
29 | 0 | public boolean accept(File dir, String filename) {
30 | 0 | return (fileSelector.isWantedFile(filename) || (new File(dir.getAbsolutePath() + fileSeparator + filename).isDirectory())) && !filename.equals("SCCS");
31 |  | // Remark: Why not use "new File(dir, filename).isDirectory()" ?
32 |  | }
33 |  | }