static void writeStringToFile(final String string,final File file) throws IOException {
  createFile(file);
  try (PrintWriter printWriter=new PrintWriter(file)){
    printWriter.print(string);
  }
 }

static void writeStringToFile ( final String string , final File file ) throws IOException { createFile ( file ) ; try ( PrintWriter printWriter = new PrintWriter ( file ) ) { printWriter . print ( string ) ; } }
writes a string to a file .
