diff options
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(); } |