}
private IReportVisitor createFormatter() throws IOException {
final File file = new File(destination);
if (HTML.equals(format)) {
HTMLFormatter htmlFormatter = new HTMLFormatter();
htmlFormatter.setFooterText(session.getDescription());
return htmlFormatter.createVisitor(new FileMultiReportOutput(file));
}
final OutputStream out = new BufferedOutputStream(
new FileOutputStream(file));
switch (format) {
case HTMLZIP:
final HTMLFormatter htmlFormatter = new HTMLFormatter();
htmlFormatter.setFooterText(session.getDescription());
return htmlFormatter.createVisitor(new ZipMultiReportOutput(out));
case XML:
final XMLFormatter xmlFormatter = new XMLFormatter();
return xmlFormatter.createVisitor(out);
case CSV:
final CSVFormatter csvFormatter = new CSVFormatter();