Here you can find the source of writeFile(String content, String path)
Parameter | Description |
---|---|
content | a parameter |
path | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static void writeFile(String content, String path) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.Writer; public class Main { /***/*from w w w. ja v a2 s . c o m*/ * It is called to save a file * * @param content * @param path * @throws IOException */ public static void writeFile(String content, String path) throws IOException { Writer writer = new BufferedWriter(new FileWriter(new File(path))); writer.write(content); writer.close(); } }