aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-scanner-protocol
diff options
context:
space:
mode:
authorJanos Gyerik <janos.gyerik@sonarsource.com>2018-09-11 18:01:57 +0200
committersonartech <sonartech@sonarsource.com>2018-10-10 09:23:04 +0200
commit9d3bcaf129a89e1fd11e47ef8ce2a357ef7e81d6 (patch)
treedd37a9e066c1d8c688176829cdd78a929aa64a27 /sonar-scanner-protocol
parent8b06219ef58e8eb5382ff1310747632e2c2d366e (diff)
downloadsonarqube-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.java8
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();
}