net.sf.debianmaven.LogOutputStream Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of debian-maven-plugin Show documentation
Show all versions of debian-maven-plugin Show documentation
This plugin helps building DEB packages from Maven projects.
The packages can be used in DEB-based operating systems such
as Debian and Ubuntu. The plugin uses external Debian tools
to do the actual packaging.
The newest version!
package net.sf.debianmaven;
import java.io.IOException;
import java.io.OutputStream;
import org.apache.maven.plugin.logging.Log;
public class LogOutputStream extends OutputStream
{
private final Log backend;
private StringBuffer buffer = new StringBuffer();
public LogOutputStream(Log backend)
{
this.backend = backend;
}
@Override
public void write(int ch) throws IOException
{
if ((char)ch == '\n')
{
backend.warn(buffer.toString());
buffer.setLength(0);
}
else
buffer.append((char)ch);
}
}