diff options
author | Janos Gyerik <janos.gyerik@sonarsource.com> | 2018-09-11 18:01:57 +0200 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2018-10-10 09:23:04 +0200 |
commit | 9d3bcaf129a89e1fd11e47ef8ce2a357ef7e81d6 (patch) | |
tree | dd37a9e066c1d8c688176829cdd78a929aa64a27 /sonar-scanner-protocol | |
parent | 8b06219ef58e8eb5382ff1310747632e2c2d366e (diff) | |
download | sonarqube-9d3bcaf129a89e1fd11e47ef8ce2a357ef7e81d6.tar.gz sonarqube-9d3bcaf129a89e1fd11e47ef8ce2a357ef7e81d6.zip |
SONAR-11241 Persist analysis warnings from scanner report
Diffstat (limited to 'sonar-scanner-protocol')
-rw-r--r-- | sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java index c52726e48c1..fa590ae9085 100644 --- a/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java +++ b/sonar-scanner-protocol/src/main/java/org/sonar/scanner/protocol/output/ScannerReportReader.java @@ -209,6 +209,14 @@ public class ScannerReportReader { return Protobuf.readStream(file, ScannerReport.ContextProperty.parser()); } + public CloseableIterator<ScannerReport.AnalysisWarning> readAnalysisWarnings() { + File file = fileStructure.analysisWarnings(); + if (!fileExists(file)) { + return emptyCloseableIterator(); + } + return Protobuf.readStream(file, ScannerReport.AnalysisWarning.parser()); + } + private static boolean fileExists(File file) { return file.exists() && file.isFile(); } |