Clover Coverage Report - Maven Impex Plugin 1.0.22-SNAPSHOT
Coverage timestamp: Wed Dec 31 1969 19:00:00 EST
../../../../img/srcFileCovDistChart0.png 0% of files have more coverage
16   46   6   5.33
6   34   0.38   3
3     2  
1    
 
  SimpleScanner       Line # 12 16 0% 6 25 0% 0.0
 
No Tests
 
1    package org.apache.torque.util;
2   
3    import java.io.File;
4    import java.util.ArrayList;
5    import java.util.List;
6   
7    import org.codehaus.plexus.util.DirectoryScanner;
8   
9    /**
10    * This class provides a simple method for scanning a directory for files that match include/exclude patterns
11    */
 
12    public class SimpleScanner extends DirectoryScanner {
13    private static final String FS = System.getProperty("file.separator");
14   
 
15  0 toggle public SimpleScanner() {
16  0 this(null, null, null);
17    }
18   
 
19  0 toggle public SimpleScanner(File baseDir, String include, String exclude) {
20  0 super();
21  0 if (baseDir != null) {
22  0 setBasedir(baseDir);
23    }
24  0 if (include != null) {
25  0 setIncludes(new String[] { include });
26    }
27  0 if (exclude != null) {
28  0 setExcludes(new String[] { exclude });
29    }
30    }
31   
32    /**
33    * This method returns files that match an include pattern but do not match an exclude pattern
34    */
 
35  0 toggle public List<File> getFiles() {
36  0 scan();
37  0 String[] includedFiles = getIncludedFiles();
38  0 List<File> files = new ArrayList<File>();
39  0 for (String includedFile : includedFiles) {
40  0 String filename = getBasedir().getAbsolutePath() + FS + includedFile;
41  0 File file = new File(filename);
42  0 files.add(file);
43    }
44  0 return files;
45    }
46    }