}
}
}
private void saveReportFile(Map<String, Result> results, String reportType, String reportFile) {
JSHintReporter reporter = null;
if(JSLintReporter.FORMAT.equalsIgnoreCase(reportType)){
reporter = new JSLintReporter();
}else if(CheckStyleReporter.FORMAT.equalsIgnoreCase(reportType)){
reporter = new CheckStyleReporter();
}else if(StringUtils.isNotBlank(reportType)){
getLog().warn("Unknown reporter \"" + reportType + "\". Skip reporting.");
return;
}else{
return;
}
File file = StringUtils.isNotBlank(reportFile) ?
new File(reportFile) : new File("target/jshint.xml");
getLog().info(String.format("Generating \"JSHint\" report. reporter=%s, reportFile=%s.",
reportType, file.getAbsolutePath()));
String report = reporter.report(results);
Writer writer = null;
try{
writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file), "utf-8"));
writer.write(report);
}catch (IOException e){