public static Writer getWriter(Context context) {
String format = (String) context.get("format");
if (format.equals(TransferFormats.XLS) || format.equals("excel")) {
String template = (String) context.get("template");
if (StringUtils.isEmpty(template)) {
return new ExcelItemWriter();
} else {
TemplateWriter writer = new ExcelTemplateWriter();
URL templateURL = ClassLoaderUtil.getResource(template, Exporter.class);
if (null == templateURL) {
throw new RuntimeException("Empty template path!");