Here you can find the source of saveToFile(String location, File tempFile)
public static void saveToFile(String location, File tempFile) throws IOException
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FileWriter; import java.io.IOException; public class Main { public static void saveToFile(String location, File tempFile) throws IOException { FileWriter fw = new FileWriter(tempFile.getAbsolutePath(), true); // the // true // will // append // the // string // to // the // file fw.write(location + "\n"); fw.close();/*from w w w.j av a2 s .c om*/ } }