Example usage for org.apache.commons.exec PumpStreamHandler setProcessInputStream

List of usage examples for org.apache.commons.exec PumpStreamHandler setProcessInputStream

Introduction

In this page you can find the example usage for org.apache.commons.exec PumpStreamHandler setProcessInputStream.

Prototype

public void setProcessInputStream(final OutputStream os) 

Source Link

Document

Set the OutputStream by means of which input can be sent to the process.

Usage

From source file:com.blackducksoftware.tools.scmconnector.core.CommandLineExecutor.java

private void providePromptResponse(PumpStreamHandler psh, String promptResponse) throws IOException {
    if (promptResponse == null) {
        return;//from ww  w  .  j  a  v a 2  s.  co  m
    }

    OutputStream out = new ByteArrayOutputStream();
    psh.setProcessInputStream(out);
    String responseWithEOL = promptResponse + "\n";
    out.write(responseWithEOL.getBytes());
}