question: private void generateCode ( VelocityEngine ve , String templateDir , File file , VelocityContext context ) { Template tm = ve . getTemplate ( templateDir + File . separator + PIPELINE_TEMPLATE ) ; StringWriter sw = new StringWriter ( ) ; tm . merge ( context , sw ) ; try ( PrintWriter writer = new PrintWriter ( file . getAbsolutePath ( ) , "UTF-8" ) ) { writer . println ( sw ) ; } catch ( UnsupportedEncodingException | FileNotFoundException e ) { logger . log ( Level . SEVERE , "Unable to write to file" , e ) ; } }
target:  Creates a file and generates code in it using templates.