Here you can find the source of writeFile(File f, String content)
Parameter | Description |
---|---|
f | a parameter |
content | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static void writeFile(File f, String content) throws IOException
//package com.java2s; /******************************************************************************* * 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 * * Contributors:/*from w ww . j av a 2 s .c o m*/ * IBM Corporation - initial API and implementation *******************************************************************************/ import java.io.File; import java.io.FileWriter; import java.io.IOException; public class Main { /** * write string s into file f * * @param f * @param content * @throws IOException */ public static void writeFile(File f, String content) throws IOException { final FileWriter fw = new FileWriter(f); fw.append(content); fw.close(); } }