public void processTemplate( final Object obj, final String templateName, final OutputStream outputStream) throws IOException { final Template template = config.getTemplate(templateName); final Writer writer = new OutputStreamWriter(outputStream); try { template.process(obj, writer); } catch (final NullPointerException | TemplateException e) { LOG.error("Unable to process template " + templateName, e); } }