Search in sources :

Example 1 with SonarMetricsExporter

use of org.eclipse.titanium.sonar.metrics.SonarMetricsExporter in project titan.EclipsePlug-ins by eclipse.

the class SonarDataExporter method exportMetrics.

private void exportMetrics(final URI exportDir) throws IOException {
    final URI filePath = URIUtil.append(exportDir, "metrics.xml");
    final File file = new File(filePath);
    FileUtils.delete(file);
    final SonarMetricsExporter exporter = new SonarMetricsExporter();
    try {
        exporter.export(MetricData.measure(project), file);
    } catch (JAXBException e) {
        new ConsoleErrorHandler().reportException("Error while exporting the project metrics", e);
    }
}
Also used : SonarMetricsExporter(org.eclipse.titanium.sonar.metrics.SonarMetricsExporter) JAXBException(javax.xml.bind.JAXBException) ConsoleErrorHandler(org.eclipse.titanium.error.ConsoleErrorHandler) URI(java.net.URI) File(java.io.File)

Aggregations

File (java.io.File)1 URI (java.net.URI)1 JAXBException (javax.xml.bind.JAXBException)1 ConsoleErrorHandler (org.eclipse.titanium.error.ConsoleErrorHandler)1 SonarMetricsExporter (org.eclipse.titanium.sonar.metrics.SonarMetricsExporter)1