private Writer getFileWriter(File file) throws IOException { String charset = config.getTargetCharset(); if (charset != null && charset.trim().length() > 0) { return new OutputStreamWriter(new FileOutputStream(file), charset); } return new FileWriter(file); }
private Template getTemplate(File file) throws IOException { String charset = config.getTemplateCharset(); if (charset != null && charset.trim().length() > 0) { return FreemarkerFactory.getTemplate(file, charset); } return FreemarkerFactory.getTemplate(file); }