Klasse SourceCodeFacade

java.lang.Object
io.jenkins.plugins.coverage.model.visualization.code.SourceCodeFacade

public class SourceCodeFacade extends Object
Facade to the source code file structure in Jenkins build folder. Access of those files should be done using an instance of this class only.
Autor:
Ullrich Hafner, Florian Orendi
  • Konstruktordetails

    • SourceCodeFacade

      public SourceCodeFacade()
  • Methodendetails

    • read

      public String read(File buildResults, String id, String path) throws IOException, InterruptedException
      Reads the contents of the source file of the given coverage node into a String.
      Parameter:
      buildResults - Jenkins directory for build results
      id - if of the coverage results
      path - relative path to the coverage node base filename of the coverage node
      Gibt zurück:
      the file content as String
      Löst aus:
      IOException
      InterruptedException
    • createFileInBuildFolder

      public File createFileInBuildFolder(File buildResults, String id, String path)
      Returns a file to the sources in release 2.1.0 and newer. Note that the file might not exist.
      Parameter:
      buildResults - Jenkins directory for build results
      id - if of the coverage results
      path - relative path to the coverage node base filename of the coverage node
      Gibt zurück:
      the file
    • hasStoredSourceCode

      public boolean hasStoredSourceCode(File buildResults, String id)
      Checks whether any source files has been stored. Even if it is wanted, there might have been errors which cause the absence of any source files.
      Parameter:
      buildResults - Jenkins directory for build results
      id - id of the coverage results
      Gibt zurück:
      true whether source files has been stored, else false
    • calculateChangeCoverageSourceCode

      public String calculateChangeCoverageSourceCode(String content, FileCoverageNode fileNode)
      Filters the sourcecode coverage highlighting for analyzing the change coverage only.
      Parameter:
      content - The original HTML content
      fileNode - The node which represents the coverage of the file
      Gibt zurück:
      the filtered HTML sourcecode view
    • calculateIndirectCoverageChangesSourceCode

      public String calculateIndirectCoverageChangesSourceCode(String content, FileCoverageNode fileNode)
      Filters the sourcecode coverage highlighting for analyzing indirect coverage changes only.
      Parameter:
      content - The original HTML content
      fileNode - The node which represents the coverage of the file
      Gibt zurück:
      the filtered HTML sourcecode view