All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.danielflower.apprunner.io.OutputToWriterBridge Maven / Gradle / Ivy

Go to download

A self-hosted platform-as-a-service that hosts web apps written in Java, Clojure, NodeJS, Python, golang and Scala.

There is a newer version: 2.4.6
Show newest version
package com.danielflower.apprunner.io;

import org.apache.maven.shared.invoker.InvocationOutputHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.Writer;

import static org.apache.commons.io.IOUtils.LINE_SEPARATOR;

public class OutputToWriterBridge implements InvocationOutputHandler, LineConsumer {
    public static final Logger log = LoggerFactory.getLogger(OutputToWriterBridge.class);
    private final Writer writer;

    public OutputToWriterBridge(Writer writer) {
        this.writer = writer;
    }

    public void consumeLine(String line) {
        try {
            writer.write(line + LINE_SEPARATOR);
            writer.flush();
        } catch (IOException e) {
            log.info("Error while writing", e);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy