Here you can find the source of fileAppendString(String target, String source)
Parameter | Description |
---|---|
target | The file that gets appended to. |
source | The string to append. |
static public void fileAppendString(String target, String source) throws IOException
//package com.java2s; /**//from www . ja v a 2s .c o m * Util.java * @author John Green * 27-Oct-2002 * www.joanju.com * * Copyright (c) 2002 Joanju Limited. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * */ import java.io.*; public class Main { /** Append a string to a file. * @param target The file that gets appended to. * @param source The string to append. */ static public void fileAppendString(String target, String source) throws IOException { BufferedWriter out = new BufferedWriter(new FileWriter(target, true)); out.write(source); out.close(); } }