Code example for StringWriter

Methods: flushtoString

0
    } 
 
    public String processFTL(Map<String, Object> root, String inputPath) {
        try { 
            Template templateFile = config.getTemplate(inputPath);
            Writer out = new StringWriter();
            templateFile.process(root, out);
            out.flush();
            return out.toString();
        } catch (IOException e) {
            throw new RuntimeException(e);
        } catch (TemplateException e) {
            throw new RuntimeException(e);
        } 
    } 
} 
Experience pair programming with AI  Get Codota for Java