Java File Append appendFile(File file, String url)

Here you can find the source of appendFile(File file, String url)

Description

append File

License

Open Source License

Parameter

Parameter Description
file a parameter
url a parameter

Declaration

public static void appendFile(File file, String url) 

Method Source Code

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

import java.io.File;

import java.io.FileWriter;
import java.io.IOException;

public class Main {
    /**/*  w ww . j  a va  2  s.c o  m*/
     * 
     * @param file
     * @param url
     */
    public static void appendFile(File file, String url) {
        FileWriter fw;
        try {
            fw = new FileWriter(file, true); // This is true is the key  , If not, the evaluation will be a blank file overwrite originals  
            fw.write(url);
            fw.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

Related

  1. appendContentToFile(File file, String fileContent)
  2. appendFile(byte[] data, String file)
  3. appendFile(File f, String content)
  4. appendFile(File f, StringBuffer sb)
  5. appendFile(File file, String content)
  6. appendFile(File filename, String data)
  7. appendFile(File src, File dst)
  8. appendFile(File targetFile, String text)
  9. appendFile(File targetFile, String toWrite)