Class BuildFolderFacade
java.lang.Object
io.jenkins.plugins.analysis.core.util.BuildFolderFacade
- All Implemented Interfaces:
Serializable
Facade to the files in the build folder of the Jenkins controller. Encapsulates all calls to the running Jenkins
server so that tests can replace this facade with a stub.
- Author:
- Ullrich Hafner
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canAccessAffectedFileOf
(Run<?, ?> build, edu.hm.hafner.analysis.Issue issue) Returns whether the affected file of the specified issue can be accessed.readConsoleLog
(Run<?, ?> build) Returns the lines of the console log.Returns the affected file with the specified file name.
-
Constructor Details
-
BuildFolderFacade
public BuildFolderFacade()
-
-
Method Details
-
readConsoleLog
Returns the lines of the console log. If the log cannot be read, then the exception message is returned as text.- Parameters:
build
- the build to get the console log for- Returns:
- the lines of the console log
-
readFile
@MustBeClosed public Reader readFile(Run<?, ?> build, String fileName, Charset sourceEncoding) throws IOExceptionReturns the affected file with the specified file name.- Parameters:
build
- the build to read the files fromfileName
- the file to readsourceEncoding
- the encoding to use when reading the file- Returns:
- the affected file
- Throws:
IOException
- if the file could not be read
-
canAccessAffectedFileOf
Returns whether the affected file of the specified issue can be accessed.- Parameters:
build
- the build to read the files fromissue
- the issue to check the affected file for- Returns:
true
if the affected file of the specified issue can be accessed,false
otherwise
-