Here you can find the source of saveFile(String destinationFile, String contents)
public static void saveFile(String destinationFile, String contents) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; public class Main { public static void saveFile(String destinationFile, String contents) throws IOException { OutputStream os = new FileOutputStream(destinationFile); os.write(contents.getBytes());//from ww w . j a va 2 s . c om os.close(); } }