Here you can find the source of writeFile(String filePath, String content)
public static void writeFile(String filePath, String content) throws IOException
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { public static void writeFile(String filePath, String content) throws IOException { File file = new File(filePath); synchronized (file) { FileOutputStream fos = new FileOutputStream(filePath); fos.write(content.getBytes("UTF-8")); fos.close();//from w w w . j a v a 2s. c o m } } }