Clover coverage report - PMD - 3.7
Coverage timestamp: Wed May 31 2006 09:25:59 EDT

file stats: | LOC: | 30 |  | Methods: | 2
| NCLOC: | 12 |  | 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 |  | private SourceFileSelector fileSelector;
16 |  |
17 |  | /**
18 |  | * Public constructor
19 |  | *
20 |  | * @param fileSelector the FileSelector that knows what source files to accept
21 |  | */
22 | 0 | public SourceFileOrDirectoryFilter(SourceFileSelector fileSelector) {
23 | 0 | this.fileSelector = fileSelector;
24 |  | }
25 |  |
26 | 0 | public boolean accept(File dir, String filename) {
27 | 0 | return (fileSelector.isWantedFile(filename) || (new File(dir.getAbsolutePath() + System.getProperty("file.separator") + filename).isDirectory())) && !filename.equals("SCCS");
28 |  | // Remark: Why not use "new File(dir, filename).isDirectory()" ?
29 |  | }
30 |  | }