com.danielsomerfield.cvecheck.owaspdependencycheck.reporting.OWASPScanReportGenerator.groovy Maven / Gradle / Ivy
package com.danielsomerfield.cvecheck.owaspdependencycheck.reporting
import com.danielsomerfield.cvecheck.owaspdependencycheck.OWASPScanResult
import com.danielsomerfield.util.io.OutputStreamFactory
import com.danielsomerfield.cvecheck.reporting.ScanReportGenerator
import org.owasp.dependencycheck.reporting.ReportGenerator
import org.owasp.dependencycheck.reporting.ReportGenerator.Format
class OWASPScanReportGenerator implements ScanReportGenerator {
private ReportGenerator reportGenerator;
private Format format;
private OutputStreamFactory outputStreamFactory;
def OWASPScanReportGenerator(ReportGenerator reportGenerator, Format format, OutputStreamFactory outputStreamFactory) {
this.reportGenerator = reportGenerator
this.format = format;
this.outputStreamFactory = outputStreamFactory;
}
@Override
def generateReport(OWASPScanResult result) {
outputStreamFactory.getOutputStream().withCloseable { OutputStream out ->
this.reportGenerator.generateReports(out, format)
}
}
}