String content = FileManager.getURLContent(((TemplateSubTask) getDocletContext().getActiveSubTask()).getTemplateURL());
if (content != null) {
try {
PrettyPrintWriter out = new PrettyPrintWriter(new BufferedWriter(new FileWriter(file)));
getEngine().setWriter(out);
getEngine().setCurrentLineNum(0);
generate(content);
out.close();
}
catch (IOException ex) {
log.error("An error occured while writing output to file " + file, ex);
}
}