code: public static void writeFile( String text, File file ) throws IOException {
          try (BufferedWriter bw = new BufferedWriter(new FileWriter(file))) {
  
              bw.write(text);
          }
      }
docs: Write text to a file in one line.
  
  @param text the text to write.
  @param file the file to write to.
  
  @throws IOException