Java File Append appendFile(String filename, String text)

Here you can find the source of appendFile(String filename, String text)

Description

append File

License

Open Source License

Declaration

public static void appendFile(String filename, String text) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    public static void appendFile(String filename, String text) {
        FileWriter fw = null;/*from  ww  w . j av a2s  .  com*/

        try {
            fw = new FileWriter(filename, true);
            fw.append(text);
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                if (fw != null)
                    fw.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

    }
}

Related

  1. appendFile(String file, String text)
  2. appendFile(String fileContents, File toFile)
  3. appendFile(String fileName, byte[] data)
  4. appendFile(String fileName, String content)
  5. appendFile(String filename, String text)
  6. appendFile(String fileName, StringBuffer sb)
  7. appendFile(String fullName, String text)
  8. appendFile(String path, String content)
  9. appendFile(String path, String sb)