Package org.jacoco.report
Class DirectorySourceFileLocator
- java.lang.Object
-
- org.jacoco.report.InputStreamSourceFileLocator
-
- org.jacoco.report.DirectorySourceFileLocator
-
- All Implemented Interfaces:
ISourceFileLocator
public class DirectorySourceFileLocator extends InputStreamSourceFileLocator
Locator for source files that picks source files from a given directory in the file system.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.Filedirectory
-
Constructor Summary
Constructors Constructor Description DirectorySourceFileLocator(java.io.File directory, java.lang.String encoding, int tabWidth)Creates a new locator that searches for source files in the given directory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.io.InputStreamgetSourceStream(java.lang.String path)Tries to locate the given source file and opens its binary content.-
Methods inherited from class org.jacoco.report.InputStreamSourceFileLocator
getSourceFile, getTabWidth
-
-
-
-
Constructor Detail
-
DirectorySourceFileLocator
public DirectorySourceFileLocator(java.io.File directory, java.lang.String encoding, int tabWidth)Creates a new locator that searches for source files in the given directory.- Parameters:
directory- directory to search for source fileencoding- encoding of the source files,nullfor platform default encodingtabWidth- tab width in source files as number of blanks
-
-
Method Detail
-
getSourceStream
protected java.io.InputStream getSourceStream(java.lang.String path) throws java.io.IOExceptionDescription copied from class:InputStreamSourceFileLocatorTries to locate the given source file and opens its binary content.- Specified by:
getSourceStreamin classInputStreamSourceFileLocator- Parameters:
path- local path to the resource- Returns:
- stream if the file could be located,
nullotherwise - Throws:
java.io.IOException- in case of problems while opening the stream
-
-