Here you can find the source of writeFile(String filePath, String content)
Parameter | Description |
---|---|
filePath | a parameter |
content | a parameter |
public static void writeFile(String filePath, String content)
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { /**// ww w . j a v a2 s.c o m * ananya.tools.utils.FileUtils method to write string content to a file * @param filePath * @param content */ public static void writeFile(String filePath, String content) { writeFile(new File(filePath), content); } public static void writeFile(File file, String content) { try { FileWriter writer = new FileWriter(file); writer.write(content); writer.flush(); writer.close(); System.out.println("Content Written to " + file.getAbsolutePath()); } catch (IOException e) { System.err.println("Exception When writing the corpus file " + e.getMessage()); } } }