Here you can find the source of writeFile(String absoluteFileName, String content, boolean append)
Parameter | Description |
---|---|
absoluteFileName | a parameter |
content | a parameter |
append | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static void writeFile(String absoluteFileName, String content, boolean append) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.Writer; public class Main { /**//w w w. j a v a 2 s . co m * Writes a string to file * * @param absoluteFileName * @param content * @param append * @throws IOException */ public static void writeFile(String absoluteFileName, String content, boolean append) throws IOException { FileWriter fw = null; Writer writer = null; try { fw = new FileWriter(absoluteFileName, append); writer = new BufferedWriter(fw); writer.write(content); } finally { if (writer != null) writer.close(); if (fw != null) fw.close(); } } }