String outputFormat = Val.chkStr(attrMap.getValue("f"));
if (outputFormat.equalsIgnoreCase("json")
&& statReqContext.getRequestType().equalsIgnoreCase(
StatisticsTypes.HARVESTER.toString())) {
response.setContentType("text/plain; charset=UTF-8");
rsWriter = new JSONWriter(writer,
statReqContext.getResponseString());
} else if (outputFormat.equalsIgnoreCase("html")) {
throw new Exception("Output format not supported.");
} else if (outputFormat.equalsIgnoreCase("xml")) {
throw new Exception("Output format not supported.");
} else {
rsWriter = new JSONWriter(writer,
statReqContext.getResponseString());
}
statReqContext.setWriter(rsWriter);
}