Example usage for org.apache.commons.io IOUtils writeLines

List of usage examples for org.apache.commons.io IOUtils writeLines

Introduction

In this page you can find the example usage for org.apache.commons.io IOUtils writeLines.

Prototype

public static void writeLines(Collection lines, String lineEnding, OutputStream output, String encoding)
        throws IOException 

Source Link

Document

Writes the toString() value of each item in a collection to an OutputStream line by line, using the specified character encoding and the specified line ending.

Usage

From source file:poisondog.io.WriteToText.java

@Override
public Boolean execute(Collection<?> list) throws IOException, Exception {
    mTarget.create();//from  w w  w  .j  ava  2 s.  c o m
    IOUtils.writeLines(list, null, mTarget.getOutputStream(), "utf8");
    System.out.println("Save to: " + mTarget.getUrl());
    return true;
}