Example usage for com.google.common.io CharStreams readLines

List of usage examples for com.google.common.io CharStreams readLines

Introduction

In this page you can find the example usage for com.google.common.io CharStreams readLines.

Prototype

public static <T> T readLines(Readable readable, LineProcessor<T> processor) throws IOException 

Source Link

Document

Streams lines from a Readable object, stopping when the processor returns false or all lines have been read and returning the result produced by the processor.

Usage

From source file:org.apache.aurora.common.args.apt.Configuration.java

private static Configuration load(int nextIndex, List<URL> configs) throws ConfigurationException, IOException {
    CharSource input = CharSource.concat(Iterables.transform(configs, URL_TO_SOURCE));
    try (Reader reader = input.openStream()) {
        return CharStreams.readLines(reader, new ConfigurationParser(nextIndex));
    }/*  ww  w.j  a va 2  s  .c o  m*/
}

From source file:com.twitter.common.args.apt.Configuration.java

private static Configuration load(int nextIndex, List<URL> configs) throws ConfigurationException, IOException {
    InputSupplier<Reader> input = CharStreams.join(Iterables.transform(configs, URL_TO_READER));
    return CharStreams.readLines(input, new ConfigurationParser(nextIndex));
}