net.sourceforge.cobertura.util
public class FileFinder extends Object
FileFinder supports two types of source files locations:
| Field Summary | |
|---|---|
| static Logger | LOGGER |
| Set | sourceDirectories |
| Map | sourceFilesMap |
| Method Summary | |
|---|---|
| void | addSourceDirectory(String directory)
Adds directory that is a root of sources. |
| void | addSourceFile(String baseDir, String file)
Adds file by specifying root directory and relative path to the
file in it. |
| String | getCorrectedPath(String path) |
| File | getFileForSource(String fileName)
Maps source file name to existing file.
|
| List | getSourceDirectoryList()
Returns a list with string for all source directories.
|
| String | toString()
Returns string representation of FileFinder. |
Example:
fileFinder.addSourceDirectory( "C:/MyProject/src/main"); fileFinder.addSourceDirectory( "C:/MyProject/src/test");In path both / and \ can be used.
Parameters: directory The root of source files
Throws: NullPointerException if directory is null
Example:
fileFinder.addSourceFile( "C:/MyProject/src/main", "com/app/MyClass.java"); fileFinder.addSourceFile( "C:/MyProject/src/test", "com/app/MyClassTest.java");In paths both / and \ can be used.
Parameters: baseDir sources root directory file path to source file relative to baseDir
Throws: NullPointerException if either baseDir or file is null
Parameters: fileName source file to be mapped
Returns: existing file that maps to passed sourceFile
Throws: IOException if cannot map source file to existing file NullPointerException if fileName is null
[C:/MyProject/src/main,C:/MyProject/src/test]
Returns: list with Strings for all source roots, or empty list if no source roots were specified