Here you can find the source of writeString(File file, String content, boolean append)
public static void writeString(File file, String content, boolean append)
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FileWriter; import java.io.IOException; public class Main { public static void writeString(File file, String content, boolean append) { try {/* w w w . jav a 2s .c o m*/ if (!file.exists()) { file.getParentFile().mkdirs(); file.createNewFile(); } final FileWriter fileWriter = new FileWriter(file, append); fileWriter.append(content); fileWriter.close(); } catch (final IOException e) { throw new RuntimeException(e); } } }