channel.setExtOutputStream(System.err, true); channel.setPty(true); channel.connect();
public void setErrStream(java.io.OutputStream out){ setExtOutputStream(out); } public void setErrStream(java.io.OutputStream out, boolean dontclose){
/** * Sets the error stream. The standard error output of the remote * process will be sent to this stream. * * The stream will be closed on {@link #disconnect}. */ public void setErrStream(java.io.OutputStream out){ setExtOutputStream(out); }
/** * Sets the error stream. The standard error output of the remote * process will be sent to this stream. * * @param dontclose if true, we do not close the stream * on {@link #disconnect}. */ public void setErrStream(java.io.OutputStream out, boolean dontclose){ setExtOutputStream(out, dontclose); }
public void setErrStream(java.io.OutputStream out, boolean dontclose){ setExtOutputStream(out, dontclose); } public java.io.InputStream getErrStream() throws java.io.IOException {
public void setErrStream(OutputStream out) { setExtOutputStream(out); } }
public void setErrStream(java.io.OutputStream out){ setExtOutputStream(out); } public void setErrStream(java.io.OutputStream out, boolean dontclose){
public void setErrStream(java.io.OutputStream out, boolean dontclose){ setExtOutputStream(out, dontclose); } public java.io.InputStream getErrStream() throws java.io.IOException {
public void setErrStream(java.io.OutputStream out){ setExtOutputStream(out); } public void setErrStream(java.io.OutputStream out, boolean dontclose){
public void setErrStream(java.io.OutputStream out, boolean dontclose){ setExtOutputStream(out, dontclose); } public java.io.InputStream getErrStream() throws java.io.IOException {
public void setErrStream(OutputStream out, boolean dontclose) { setExtOutputStream(out, dontclose); }
private ChannelExec createChannel(final PrintStream logger, final Session session) throws JSchException { final ChannelExec channel = (ChannelExec) session.openChannel("exec"); channel.setOutputStream(logger, true); channel.setExtOutputStream(logger, true); channel.setInputStream(null); if (pty == null) { pty = Boolean.FALSE; } channel.setPty(pty); return channel; }
channel = (ChannelExec) session.openChannel("exec"); channel.setOutputStream(out, true); channel.setExtOutputStream(out, true); channel.setPty(Boolean.FALSE.booleanValue()); channel.setCommand(command);
channel = (ChannelExec) session.openChannel("exec"); channel.setOutputStream(output, true); channel.setExtOutputStream(output, true); channel.setPty(Boolean.FALSE); channel.setCommand(wrapperCommand);
channel.setExtOutputStream(System.err, true); channel.setPty(true); channel.connect();
channel.setCommand(cmd); channel.setOutputStream(tee); channel.setExtOutputStream(tee); channel.setErrStream(teeErr); if (istream != null) {
public static Process start(SshRoot root, boolean tty, OutputStream out, String ... command) throws JSchException { TimedOutputStream dest; ChannelExec channel; dest = new TimedOutputStream(out); channel = root.createChannelExec(); // tty=true propagates ctrl-c to the remote host: // (unfortunately, this causes ssh servers to send cr/lf, and I didn't find // a way to stop this - I tried setPtyType and setTerminalMode) channel.setPty(tty); // TODO: http://tools.ietf.org/html/rfc4250 // TODO: channel.setTerminalMode(new byte[] { 70, 0, 0, 0, 0, /*71, 0, 0, 0, 0,*/ 0 }); channel.setCommand(Separator.SPACE.join(command)); channel.setInputStream(null); channel.setOutputStream(dest); channel.setExtOutputStream(dest); channel.connect(); return new Process(root, command, channel, dest); }
channel.setExtOutputStream(new KeepAliveOutputStream(System.err), true); if (istream != null) { channel.setInputStream(istream);
public static Process start(SshRoot root, boolean tty, OutputStream out, String ... command) throws JSchException { TimedOutputStream dest; ChannelExec channel; dest = new TimedOutputStream(out); channel = root.createChannelExec(); // tty=true propagates ctrl-c to the remote host: // (unfortunately, this causes ssh servers to send cr/lf, and I didn't find // a way to stop this - I tried setPtyType and setTerminalMode) channel.setPty(tty); // TODO: http://tools.ietf.org/html/rfc4250 // TODO: channel.setTerminalMode(new byte[] { 70, 0, 0, 0, 0, /*71, 0, 0, 0, 0,*/ 0 }); channel.setCommand(Separator.SPACE.join(command)); channel.setInputStream(null); channel.setOutputStream(dest); channel.setExtOutputStream(dest); channel.connect(); return new Process(root, command, channel, dest); }