Java File Append Text appendToFile(final String filePath, final String textToAppend)

Here you can find the source of appendToFile(final String filePath, final String textToAppend)

Description

append To File

License

Open Source License

Declaration

public static boolean appendToFile(final String filePath, final String textToAppend) 

Method Source Code

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

import java.io.FileWriter;

public class Main {
    public static boolean appendToFile(final String filePath, final String textToAppend) {
        try (FileWriter fw = new FileWriter(filePath, true)) {
            fw.write(textToAppend);/* w w  w. j  a  v  a2s .  c o  m*/
            fw.close();
            return true;
        } catch (final Exception e) {
            return false;
        }
    }
}

Related

  1. appendTextToFile(String text, File file)
  2. appendToFile(File destFile, InputStream source)
  3. appendToFile(File file, String data)
  4. appendToFile(File tempFile, String str)
  5. appendToFile(final File file, final String contents)
  6. appendToFile(final String text, final String urlFile)
  7. appendToFile(float[] in, String filename)
  8. appendToFile(IFile file, String output)
  9. appendToFile(List strList, File file)