question: public static String createTempFile ( final String ... lines ) throws Exception { final File f = File . createTempFile ( "LDIFBasedTestCase" , ".txt" ) ; f . deleteOnExit ( ) ; try ( final FileWriter w = new FileWriter ( f ) ) { for ( final String s : lines ) { w . write ( s + System . getProperty ( "line.separator" ) ) ; } } return f . getAbsolutePath ( ) ; }
target:  Creates a temporary text file with the specified contents. It will be marked for automatic deletion when the JVM exits.