Here you can find the source of writeFileCover(String path, String content)
public static void writeFileCover(String path, String content) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileOutputStream; import java.io.IOException; public class Main { public static void writeFileCover(String path, String content) throws IOException { File file = new File(path); if (!file.exists()) { file.createNewFile();/*from w w w .j a v a2 s .c o m*/ } FileOutputStream outputStream = new FileOutputStream(file, false); outputStream.write(content.getBytes("utf-8")); outputStream.close(); } }