Here you can find the source of copyStringToFile(String content, String FilePath)
Parameter | Description |
---|
Parameter | Description |
---|---|
IOException | an exception |
public static void copyStringToFile(String content, String FilePath) throws IOException
//package com.java2s; import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; public class Main { /**/*from w w w. ja v a2s .c o m*/ * Copy String to a File. * * @param content: String content to be copied to the File. * @param FilePath: File Absolute Path. * * @throws IOException */ public static void copyStringToFile(String content, String FilePath) throws IOException { FileWriter fstream = new FileWriter(FilePath); BufferedWriter out = new BufferedWriter(fstream); out.write(content); out.close(); } }