Class PolyspaceHelpersUtils
java.lang.Object
com.mathworks.polyspace.jenkins.utils.PolyspaceHelpersUtils
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSmall utility class to hold a results runId and projectId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidappendLineInFile(Path file, String line) Appendlinewith a new line infilestatic StringgetAccessResultProjectId(Path output) static StringgetAccessResultRunId(Path output) static StringgetAccessResultUrl(Path output, String accessURL) static longgetCountFindings(Path report) static PathgetReportOwner(Path report, String owner) Build the report-owner filename: Owner is empty: "report" unmodified Report without extension: "report_owner" Report with extension: "report_owner.ext"static PathgetReportOwnerList(Path report) Build the report-owner-list filename:report.owners.liststatic StringgetReportStatus(Path report, long max) static BooleanisOwnerInFile(Path ownerList, String owner) static voidreportFilter(Path originalReport, Path filteredReport, String owner, String[] filters) FilteroriginalReportagainstfiltersintofilteredReportassociated withownerstatic intreportGetColId(String line, String token) Get the column ID oftokeninlineNote that tokens inlineare separated by tabs
-
Constructor Details
-
PolyspaceHelpersUtils
public PolyspaceHelpersUtils()
-
-
Method Details
-
isOwnerInFile
- Parameters:
ownerList- - The owner list fileowner- - An owner- Returns:
trueifowneris inownerList-falseotherwise- Throws:
IOException- Error while accessingownerList
-
appendLineInFile
Appendlinewith a new line infile- Parameters:
file- - Path to a fileline- - Line string to add- Throws:
IOException- Error while accessingfile
-
getReportOwner
Build the report-owner filename:- Owner is empty: "
report" unmodified - Report without extension: "
report_owner" - Report with extension: "
report_owner.ext"
- Parameters:
report- - Path to the reportowner- - An owner- Returns:
- The report-owner filename
- Owner is empty: "
-
getReportOwnerList
Build the report-owner-list filename:report.owners.list- Parameters:
report- - Path to the report- Returns:
- The report-owner-list filename
-
reportGetColId
Get the column ID oftokeninlineNote that tokens inlineare separated by tabs- Parameters:
line- - Line string containing the report column namestoken- - Searched token- Returns:
- The column ID
-
reportFilter
public static void reportFilter(Path originalReport, Path filteredReport, String owner, String[] filters) throws IOException FilteroriginalReportagainstfiltersintofilteredReportassociated withowner- Parameters:
originalReport- - Path to original reportfilteredReport- - Path to the new filtered report - it may already exist to allow to append multiple filtered reportsowner- - The owner for the filtered report - must be a username matching an email as it will also be used to send the email notificationfilters- - An array of strings containing one or more "key" "value" pairs- Throws:
IOException- Error while accessingoriginalReportorfilteredReport
-
getCountFindings
- Parameters:
report- - Path to the report- Returns:
- - Number of findings in
report: number of lines - 1 (title line) - Throws:
IOException- Error while accessingreport
-
getReportStatus
- Parameters:
report- - Path to the reportmax- - Thereshold for status- Returns:
- - Job status string: SUCCESS if num findings smaller than
max, UNSTABLE otherwise - Throws:
IOException- Error while accessingreport
-
getAccessResultRunId
- Parameters:
output- - Path to the report- Returns:
- Result runId
- Throws:
IOException- Error while accessingoutput
-
getAccessResultProjectId
- Parameters:
output- - Path to the report- Returns:
- Result projectId
- Throws:
IOException- Error while accessingoutput
-
getAccessResultUrl
- Parameters:
output- - Path to the reportaccessURL- - Root Access server URL- Returns:
- Results URL
- Throws:
IOException- Error while accessingoutput
-