Here you can find the source of writeStringToFile(String path, String content)
Parameter | Description |
---|---|
path | a parameter |
content | a parameter |
Parameter | Description |
---|---|
IOException | an exception |
public static void writeStringToFile(String path, String content) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FileOutputStream; import java.io.IOException; public class Main { /**//w w w. jav a 2 s.c o m * * @param path * @param content * @throws IOException */ public static void writeStringToFile(String path, String content) throws IOException { File f = new File(path); FileOutputStream out = new FileOutputStream(f); out.write(content.getBytes()); out.close(); } }