out = new FileWriter(f); generateProfile(cfg, template, out);
Writer unformatted = new StringWriter(); generateProfile(cfg, template, unformatted); out = new FileWriter(f); format(new StringReader(unformatted.toString()), out);
    void generateProfile(VelocityProfileGenerator cfg, String template, String outputFile) {        FileWriter out = null;        try {            File f = new File(getTftpRoot(), outputFile);            VelocityProfileGenerator.makeParentDirectory(f);            out = new FileWriter(f);            generateProfile(cfg, template, out);        } catch (IOException ioe) {            throw new RuntimeException("Could not generate profile " + outputFile                    + " from template " + template, ioe);        } finally {            if (out != null) {                IOUtils.closeQuietly(out);            }        }    }