question: public static void createFile ( String filePath , String header ) throws IOException { File file = new File ( filePath ) ; if ( ! file . exists ( ) ) { file . createNewFile ( ) ; FileWriter fileWriter = new FileWriter ( filePath , true ) ; fileWriter . write ( header ) ; fileWriter . close ( ) ; } }
target:  Checks whether the given file exists. If not, create such a file with a header written into it.