com.jcraft.jsch
Class ChannelExec

java.lang.Object
  extended by com.jcraft.jsch.Channel
      extended by com.jcraft.jsch.ChannelExec
All Implemented Interfaces:
java.lang.Runnable

public class ChannelExec
extends Channel


Field Summary
protected  boolean agent_forwarding
           
protected  java.util.Hashtable env
           
protected  boolean pty
           
protected  int tcol
           
protected  byte[] terminal_mode
           
protected  int thp
           
protected  int trow
           
protected  java.lang.String ttype
           
protected  int twp
           
protected  boolean xforwading
           
 
Fields inherited from class com.jcraft.jsch.Channel
type
 
Constructor Summary
ChannelExec()
           
 
Method Summary
 java.io.InputStream getErrStream()
           
 void run()
           
protected  void sendRequests()
           
 void setAgentForwarding(boolean enable)
          Enable the agent forwarding.
 void setCommand(byte[] command)
           
 void setCommand(java.lang.String command)
           
 void setEnv(byte[] name, byte[] value)
          Set the environment variable.
 void setEnv(java.util.Hashtable env)
          Deprecated. Use setEnv(String, String) or setEnv(byte[], byte[]) instead.
 void setEnv(java.lang.String name, java.lang.String value)
          Set the environment variable.
 void setErrStream(java.io.OutputStream out)
           
 void setErrStream(java.io.OutputStream out, boolean dontclose)
           
 void setPty(boolean enable)
          Allocate a Pseudo-Terminal.
 void setPtySize(int col, int row, int wp, int hp)
          Change the window dimension interactively.
 void setPtyType(java.lang.String ttype)
          Set the terminal type.
 void setPtyType(java.lang.String ttype, int col, int row, int wp, int hp)
          Set the terminal type.
 void setTerminalMode(byte[] terminal_mode)
          Set the terminal mode.
 void setXForwarding(boolean enable)
          Enable the X11 forwarding.
 void start()
           
 
Methods inherited from class com.jcraft.jsch.Channel
connect, connect, disconnect, genChannelOpenPacket, getExitStatus, getExtInputStream, getId, getInputStream, getOutputStream, getSession, isClosed, isConnected, isEOF, sendChannelOpen, sendOpenConfirmation, sendOpenFailure, sendSignal, setExtOutputStream, setExtOutputStream, setInputStream, setInputStream, setOutputStream, setOutputStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

agent_forwarding

protected boolean agent_forwarding

xforwading

protected boolean xforwading

env

protected java.util.Hashtable env

pty

protected boolean pty

ttype

protected java.lang.String ttype

tcol

protected int tcol

trow

protected int trow

twp

protected int twp

thp

protected int thp

terminal_mode

protected byte[] terminal_mode
Constructor Detail

ChannelExec

public ChannelExec()
Method Detail

start

public void start()
           throws JSchException
Overrides:
start in class Channel
Throws:
JSchException

setCommand

public void setCommand(java.lang.String command)

setCommand

public void setCommand(byte[] command)

setErrStream

public void setErrStream(java.io.OutputStream out)

setErrStream

public void setErrStream(java.io.OutputStream out,
                         boolean dontclose)

getErrStream

public java.io.InputStream getErrStream()
                                 throws java.io.IOException
Throws:
java.io.IOException

setAgentForwarding

public void setAgentForwarding(boolean enable)
Enable the agent forwarding.

Parameters:
enable -

setXForwarding

public void setXForwarding(boolean enable)
Enable the X11 forwarding. Refer to RFC4254 6.3.1. Requesting X11 Forwarding.

Overrides:
setXForwarding in class Channel
Parameters:
enable -

setEnv

public void setEnv(java.util.Hashtable env)
Deprecated. Use setEnv(String, String) or setEnv(byte[], byte[]) instead.

See Also:
setEnv(String, String), setEnv(byte[], byte[])

setEnv

public void setEnv(java.lang.String name,
                   java.lang.String value)
Set the environment variable. If name and value are needed to be passed to the remote in your favorite encoding, use setEnv(byte[], byte[]). Refer to RFC4254 6.4 Environment Variable Passing.

Parameters:
name - A name for environment variable.
value - A value for environment variable.

setEnv

public void setEnv(byte[] name,
                   byte[] value)
Set the environment variable. Refer to RFC4254 6.4 Environment Variable Passing.

Parameters:
name - A name of environment variable.
value - A value of environment variable.
See Also:
setEnv(String, String)

setPty

public void setPty(boolean enable)
Allocate a Pseudo-Terminal. Refer to RFC4254 6.2. Requesting a Pseudo-Terminal.

Parameters:
enable -

setTerminalMode

public void setTerminalMode(byte[] terminal_mode)
Set the terminal mode.

Parameters:
terminal_mode -

setPtySize

public void setPtySize(int col,
                       int row,
                       int wp,
                       int hp)
Change the window dimension interactively. Refer to RFC4254 6.7. Window Dimension Change Message.

Parameters:
col - terminal width, columns
row - terminal height, rows
wp - terminal width, pixels
hp - terminal height, pixels

setPtyType

public void setPtyType(java.lang.String ttype)
Set the terminal type. This method is not effective after Channel#connect().

Parameters:
ttype - terminal type(for example, "vt100")
See Also:
setPtyType(String, int, int, int, int)

setPtyType

public void setPtyType(java.lang.String ttype,
                       int col,
                       int row,
                       int wp,
                       int hp)
Set the terminal type. This method is not effective after Channel#connect().

Parameters:
ttype - terminal type(for example, "vt100")
col - terminal width, columns
row - terminal height, rows
wp - terminal width, pixels
hp - terminal height, pixels

sendRequests

protected void sendRequests()
                     throws java.lang.Exception
Throws:
java.lang.Exception

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class Channel