public class ChannelSubsystem extends Channel
ChannelExec channel = (ChannelExec)session.openChannel
("subsystem"); channel.setSubsystem
(cmd);
Modifier and Type | Field and Description |
---|---|
protected boolean |
agent_forwarding |
protected Hashtable |
env |
protected int |
tcol |
protected byte[] |
terminal_mode |
protected int |
thp |
protected int |
trow |
protected String |
ttype |
protected int |
twp |
Constructor and Description |
---|
ChannelSubsystem() |
Modifier and Type | Method and Description |
---|---|
InputStream |
getErrStream()
Gets the error stream.
|
void |
run()
not to be called by the application.
|
protected void |
sendRequests()
creates and sends all requests indicated by the
properties
agentForwarding ,
xForwarding , pty
(and ptyType ) and
env . |
void |
setAgentForwarding(boolean enable)
Enable the agent forwarding.
|
void |
setEnv(byte[] name,
byte[] value)
Set the environment variable.
|
void |
setEnv(Hashtable env)
Deprecated.
Use
setEnv(String, String) or setEnv(byte[], byte[]) instead. |
void |
setEnv(String name,
String value)
Set the environment variable.
|
void |
setErrStream(OutputStream out)
Sets the error stream.
|
void |
setPty(boolean foo)
Allocate a Pseudo-Terminal.
|
void |
setPtySize(int col,
int row,
int wp,
int hp)
Change the window dimension interactively.
|
void |
setPtyType(String ttype)
Set the terminal type.
|
void |
setPtyType(String ttype,
int col,
int row,
int wp,
int hp)
Set the terminal type.
|
void |
setSubsystem(String foo)
Sets the name of the remote subsystem name.
|
void |
setTerminalMode(byte[] terminal_mode)
Set the terminal mode.
|
void |
setWantReply(boolean foo)
Indicates whether we want a confirmation/error reply to this request.
|
void |
setXForwarding(boolean foo)
Enable the X11 forwarding.
|
void |
start()
Not to be called externally.
|
connect, connect, disconnect, genChannelOpenPacket, getExitStatus, getExtInputStream, getId, getInputStream, getOutputStream, getSession, isClosed, isConnected, isEOF, sendChannelOpen, sendOpenConfirmation, sendOpenFailure, sendSignal, setExtOutputStream, setExtOutputStream, setInputStream, setInputStream, setOutputStream, setOutputStream
protected boolean agent_forwarding
protected Hashtable env
protected String ttype
protected int tcol
protected int trow
protected int twp
protected int thp
protected byte[] terminal_mode
public void setXForwarding(boolean foo)
public void setPty(boolean foo)
public void setWantReply(boolean foo)
public void setSubsystem(String foo)
foo
- the name of the subsystem. It should consist of only
printable ASCII characters and be a subsystem name recognized
by the remote server process.public void start() throws JSchException
Channel
Channel.connect(int)
when the connection
is established.
This implementation here does nothing, but it is overridden in some
subclasses.start
in class Channel
JSchException
public void setErrStream(OutputStream out)
Channel.disconnect(com.jcraft.jsch.Session)
.public InputStream getErrStream() throws IOException
setErrStream(java.io.OutputStream)
.IOException
public void setAgentForwarding(boolean enable)
enable
- public void setEnv(Hashtable env)
setEnv(String, String)
or setEnv(byte[], byte[])
instead.setEnv(String, String)
,
setEnv(byte[], byte[])
public void setEnv(String name, String value)
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.name
- A name for environment variable.value
- A value for environment variable.public void setEnv(byte[] name, byte[] value)
name
- A name of environment variable.value
- A value of environment variable.setEnv(String, String)
public void setTerminalMode(byte[] terminal_mode)
terminal_mode
- public void setPtySize(int col, int row, int wp, int hp)
col
- terminal width, columnsrow
- terminal height, rowswp
- terminal width, pixelshp
- terminal height, pixelspublic void setPtyType(String ttype)
ttype
- terminal type(for example, "vt100")setPtyType(String, int, int, int, int)
public void setPtyType(String ttype, int col, int row, int wp, int hp)
ttype
- terminal type(for example, "vt100")col
- terminal width, columnsrow
- terminal height, rowswp
- terminal width, pixelshp
- terminal height, pixelsprotected void sendRequests() throws Exception
agentForwarding
,
xForwarding
, pty
(and ptyType
) and
env
.Exception
This is a simplified version of the inofficial Javadoc created by PaĆlo Ebermann. Have a look at the official homepage.