Here you can find the source of dumptoTempFile(List
static File dumptoTempFile(List<String> lineItems) throws IOException, FileNotFoundException
//package com.java2s; //License from project: Apache License import java.io.*; import java.util.List; public class Main { static File dumptoTempFile(List<String> lineItems) throws IOException, FileNotFoundException { // now rebuild the lines using the break rule... File createTempFile = File.createTempFile("brule", "log"); BufferedWriter writer = new BufferedWriter(new OutputStreamWriter( new FileOutputStream(createTempFile))); for (String line : lineItems) { writer.write(line);/*www . j a va 2 s .com*/ writer.newLine(); } writer.close(); return createTempFile; } }