Project project = getProject(request);
Engine engine = getEngine(request, project);
Properties params = getRequestParameters(request);
String format = params.getProperty("format");
Exporter exporter = ExporterRegistry.getExporter(format);
if (exporter == null) {
exporter = new CsvExporter('\t');
}
String contentType = params.getProperty("contentType");
if (contentType == null) {
contentType = exporter.getContentType();
}
response.setHeader("Content-Type", contentType);
if (exporter instanceof WriterExporter) {
String encoding = params.getProperty("encoding");