Here you can find the source of writeFileFromString(File outputFileName, String content)
Parameter | Description |
---|---|
outputFileName | a parameter |
content | a parameter |
public static boolean writeFileFromString(File outputFileName, String content)
//package com.java2s; //License from project: Apache License import java.io.*; public class Main { /**/*from ww w . j a v a 2 s .c o m*/ * ouputs a new file * @param outputFileName * @param content * @return */ public static boolean writeFileFromString(File outputFileName, String content) { try { //File fileName = new File(outputFileName); FileOutputStream fos2 = new FileOutputStream(outputFileName, false); fos2.write(content.getBytes()); fos2.close(); } catch (IOException ioe) { return false; } return true; } }