protected void generateFile ( File file , String templateName , VelocityContext context ) throws Exception { Writer writer = new BufferedWriter ( new FileWriter ( file ) ) ; try { Velocity . mergeTemplate ( classpathPrefix + templateName , ENCODING , context , writer ) ; writer . flush ( ) ; } finally { writer . close ( ) ; } }
Generate the specified output file by merging the specified Velocity template with the supplied context .