public static void writeToFile(File outputFile,String content) throws IOException {
  Preconditions.checkNotNull(outputFile);
  Preconditions.checkNotNull(content);
  try (BufferedWriter outWriter=Files.newWriter(outputFile,StandardCharsets.UTF_8)){
    outWriter.write(content);
  }
 }

public static void writeToFile ( File outputFile , String content ) throws IOException { Preconditions . checkNotNull ( outputFile ) ; Preconditions . checkNotNull ( content ) ; try ( BufferedWriter outWriter = Files . newWriter ( outputFile , StandardCharsets . UTF_8 ) ) { outWriter . write ( content ) ; } }
writes string content to a file .
