Class AffectedFilesResolver
- java.lang.Object
-
- io.jenkins.plugins.analysis.core.util.AffectedFilesResolver
-
public class AffectedFilesResolver extends Object
Copies all affected files that are referenced in at least one of the issues to Jenkins build folder. These files can be inspected in the UI later on.- Author:
- Ullrich Hafner
-
-
Field Summary
Fields Modifier and Type Field Description static String
AFFECTED_FILES_FOLDER_NAME
Sub folder with the affected files.
-
Constructor Summary
Constructors Constructor Description AffectedFilesResolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
copyAffectedFilesToBuildFolder(edu.hm.hafner.analysis.Report report, FilePath workspace, Set<String> permittedSourceDirectories, FilePath buildFolder)
Copies all files with issues from the workspace to the build folder.void
copyAffectedFilesToBuildFolder(edu.hm.hafner.analysis.Report report, hudson.remoting.VirtualChannel channel, FilePath buildFolder, Set<String> permittedSourceDirectories)
Deprecated.static Path
getFile(Run<?,?> run, String fileName)
Returns the affected file in Jenkins' build folder.static boolean
hasAffectedFile(Run<?,?> run, edu.hm.hafner.analysis.Issue issue)
Returns whether the affected file in Jenkins' build folder does exist and is readable.
-
-
-
Field Detail
-
AFFECTED_FILES_FOLDER_NAME
public static final String AFFECTED_FILES_FOLDER_NAME
Sub folder with the affected files.- See Also:
- Constant Field Values
-
-
Method Detail
-
hasAffectedFile
public static boolean hasAffectedFile(Run<?,?> run, edu.hm.hafner.analysis.Issue issue)
Returns whether the affected file in Jenkins' build folder does exist and is readable.- Parameters:
run
- the run referencing the build folderissue
- the issue in the affected file- Returns:
- the file
-
getFile
public static Path getFile(Run<?,?> run, String fileName)
Returns the affected file in Jenkins' build folder.- Parameters:
run
- the run referencing the build folderfileName
- the file name in the folder of affected files- Returns:
- the file
-
copyAffectedFilesToBuildFolder
public void copyAffectedFilesToBuildFolder(edu.hm.hafner.analysis.Report report, FilePath workspace, Set<String> permittedSourceDirectories, FilePath buildFolder) throws InterruptedException
Copies all files with issues from the workspace to the build folder.- Parameters:
report
- the issuesworkspace
- the workspace on the agentpermittedSourceDirectories
- additional permitted source code directoriesbuildFolder
- directory to store the copied files in- Throws:
InterruptedException
- if the user cancels the processing
-
copyAffectedFilesToBuildFolder
@Deprecated public void copyAffectedFilesToBuildFolder(edu.hm.hafner.analysis.Report report, hudson.remoting.VirtualChannel channel, FilePath buildFolder, Set<String> permittedSourceDirectories) throws InterruptedException
Deprecated.Copies all files with issues from the workspace to the build folder.- Parameters:
report
- the issueschannel
- virtual channel to access the files on the agentbuildFolder
- directory to store the copied files inpermittedSourceDirectories
- paths to the affected files on the agent- Throws:
InterruptedException
- if the user cancels the processing
-
-