public class ExpectShell
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
EXIT_CODE_PROCESS_ACTIVE |
static int |
EXIT_CODE_UNKNOWN |
static int |
OS_AIX
AIX operating system
|
static int |
OS_DARWIN
Darwin (MAC) operating system
|
static int |
OS_FREEBSD
FreeBSD operating system
|
static int |
OS_HPUX
HP-UX operating system
|
static int |
OS_LINUX
Linux operating system
|
static int |
OS_NETBSD
NetBSD operating system
|
static int |
OS_OPENBSD
OpenBSD operating system
|
static int |
OS_OPENVMS
OpenVMS operating system
|
static int |
OS_SOLARIS
Solaris operating system
|
static int |
OS_UNIX
Unix OS if less than this value.
|
static int |
OS_UNKNOWN
The operating system is unknown
|
static int |
OS_WINDOWS
Windows operating system
|
Constructor and Description |
---|
ExpectShell(AbstractSessionTask<SessionChannelNG> session) |
ExpectShell(AbstractSessionTask<SessionChannelNG> session,
ShellStartupTrigger trigger) |
ExpectShell(AbstractSessionTask<SessionChannelNG> session,
ShellStartupTrigger trigger,
long startupTimeout) |
ExpectShell(AbstractSessionTask<SessionChannelNG> session,
ShellStartupTrigger trigger,
long startupTimeout,
java.lang.String termtype) |
ExpectShell(AbstractSessionTask<SessionChannelNG> session,
ShellStartupTrigger trigger,
long startupTimeout,
java.lang.String termtype,
int cols,
int rows) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
execute(java.lang.String cmd) |
ShellProcess |
executeCommand(java.lang.String origCmd) |
ShellProcess |
executeCommand(java.lang.String origCmd,
boolean consume) |
ShellProcess |
executeCommand(java.lang.String origCmd,
boolean matchPromptMarker,
boolean consume) |
ShellProcess |
executeCommand(java.lang.String origCmd,
boolean matchPromptMarker,
boolean consume,
java.lang.String charset) |
ShellProcess |
executeCommand(java.lang.String origCmd,
boolean consume,
java.lang.String charset) |
ShellProcess |
executeCommand(java.lang.String origCmd,
java.lang.String charset) |
void |
exit() |
java.lang.String |
getCharacterEncoding() |
java.lang.String |
getNewline() |
int |
getNumCommandsExecuted() |
java.lang.String |
getOsDescription() |
int |
getOsType() |
java.io.InputStream |
getStartupInputStream() |
ShellReader |
getStartupReader() |
boolean |
inStartup() |
boolean |
isClosed() |
void |
setCharacterEncoding(java.lang.String characterEncoding) |
void |
setPasswordErrorText(java.lang.String passwordErrorText) |
void |
setPasswordPrompt(java.lang.String passwordPrompt) |
static void |
setShellInitTimeout(int timeout) |
ExpectShell |
su(java.lang.String cmd) |
ExpectShell |
su(java.lang.String cmd,
java.lang.String password) |
ExpectShell |
su(java.lang.String cmd,
java.lang.String password,
java.lang.String promptExpression) |
ExpectShell |
su(java.lang.String cmd,
java.lang.String password,
java.lang.String promptExpression,
ShellMatcher matcher) |
ShellProcess |
sudo(java.lang.String cmd,
java.lang.String password) |
ShellProcess |
sudo(java.lang.String cmd,
java.lang.String password,
java.lang.String promptExpression) |
ShellProcess |
sudo(java.lang.String cmd,
java.lang.String password,
java.lang.String promptExpression,
ShellMatcher matcher) |
public static final int OS_WINDOWS
public static final int OS_LINUX
public static final int OS_SOLARIS
public static final int OS_AIX
public static final int OS_DARWIN
public static final int OS_FREEBSD
public static final int OS_OPENBSD
public static final int OS_NETBSD
public static final int OS_HPUX
public static final int OS_UNIX
public static final int OS_OPENVMS
public static final int OS_UNKNOWN
public static final int EXIT_CODE_PROCESS_ACTIVE
public static final int EXIT_CODE_UNKNOWN
public ExpectShell(AbstractSessionTask<SessionChannelNG> session) throws com.sshtools.common.ssh.SshException, java.io.IOException, ShellTimeoutException
com.sshtools.common.ssh.SshException
java.io.IOException
ShellTimeoutException
public ExpectShell(AbstractSessionTask<SessionChannelNG> session, ShellStartupTrigger trigger) throws com.sshtools.common.ssh.SshException, java.io.IOException, ShellTimeoutException
com.sshtools.common.ssh.SshException
java.io.IOException
ShellTimeoutException
public ExpectShell(AbstractSessionTask<SessionChannelNG> session, ShellStartupTrigger trigger, long startupTimeout) throws com.sshtools.common.ssh.SshException, java.io.IOException, ShellTimeoutException
com.sshtools.common.ssh.SshException
java.io.IOException
ShellTimeoutException
public ExpectShell(AbstractSessionTask<SessionChannelNG> session, ShellStartupTrigger trigger, long startupTimeout, java.lang.String termtype) throws com.sshtools.common.ssh.SshException, java.io.IOException, ShellTimeoutException
com.sshtools.common.ssh.SshException
java.io.IOException
ShellTimeoutException
public ExpectShell(AbstractSessionTask<SessionChannelNG> session, ShellStartupTrigger trigger, long startupTimeout, java.lang.String termtype, int cols, int rows) throws com.sshtools.common.ssh.SshException, java.io.IOException, ShellTimeoutException
com.sshtools.common.ssh.SshException
java.io.IOException
ShellTimeoutException
public java.lang.String getCharacterEncoding()
public void setCharacterEncoding(java.lang.String characterEncoding)
public static void setShellInitTimeout(int timeout)
public java.io.InputStream getStartupInputStream()
public boolean inStartup()
public void setPasswordErrorText(java.lang.String passwordErrorText)
public void setPasswordPrompt(java.lang.String passwordPrompt)
public ShellReader getStartupReader()
public ExpectShell su(java.lang.String cmd, java.lang.String password) throws com.sshtools.common.ssh.SshIOException, com.sshtools.common.ssh.SshException, java.io.IOException, ShellTimeoutException
com.sshtools.common.ssh.SshIOException
com.sshtools.common.ssh.SshException
java.io.IOException
ShellTimeoutException
public ExpectShell su(java.lang.String cmd, java.lang.String password, java.lang.String promptExpression) throws com.sshtools.common.ssh.SshException, com.sshtools.common.ssh.SshIOException, java.io.IOException, ShellTimeoutException
com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.SshIOException
java.io.IOException
ShellTimeoutException
public ExpectShell su(java.lang.String cmd) throws com.sshtools.common.ssh.SshException, com.sshtools.common.ssh.SshIOException, java.io.IOException, ShellTimeoutException
com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.SshIOException
java.io.IOException
ShellTimeoutException
public ExpectShell su(java.lang.String cmd, java.lang.String password, java.lang.String promptExpression, ShellMatcher matcher) throws com.sshtools.common.ssh.SshException, com.sshtools.common.ssh.SshIOException, java.io.IOException, ShellTimeoutException
com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.SshIOException
java.io.IOException
ShellTimeoutException
public ShellProcess sudo(java.lang.String cmd, java.lang.String password) throws com.sshtools.common.ssh.SshException, ShellTimeoutException, java.io.IOException
com.sshtools.common.ssh.SshException
ShellTimeoutException
java.io.IOException
public ShellProcess sudo(java.lang.String cmd, java.lang.String password, java.lang.String promptExpression) throws com.sshtools.common.ssh.SshException, ShellTimeoutException, java.io.IOException
com.sshtools.common.ssh.SshException
ShellTimeoutException
java.io.IOException
public ShellProcess sudo(java.lang.String cmd, java.lang.String password, java.lang.String promptExpression, ShellMatcher matcher) throws com.sshtools.common.ssh.SshException, ShellTimeoutException, java.io.IOException
com.sshtools.common.ssh.SshException
ShellTimeoutException
java.io.IOException
public boolean isClosed()
public void exit() throws java.io.IOException, com.sshtools.common.ssh.SshException
java.io.IOException
com.sshtools.common.ssh.SshException
public void close() throws java.io.IOException, com.sshtools.common.ssh.SshException
java.io.IOException
com.sshtools.common.ssh.SshException
public java.lang.String getNewline()
public void execute(java.lang.String cmd) throws com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.SshException
public ShellProcess executeCommand(java.lang.String origCmd) throws com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.SshException
public ShellProcess executeCommand(java.lang.String origCmd, boolean consume) throws com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.SshException
public ShellProcess executeCommand(java.lang.String origCmd, java.lang.String charset) throws com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.SshException
public ShellProcess executeCommand(java.lang.String origCmd, boolean consume, java.lang.String charset) throws com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.SshException
public ShellProcess executeCommand(java.lang.String origCmd, boolean matchPromptMarker, boolean consume) throws com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.SshException
public ShellProcess executeCommand(java.lang.String origCmd, boolean matchPromptMarker, boolean consume, java.lang.String charset) throws com.sshtools.common.ssh.SshException
com.sshtools.common.ssh.SshException
public int getNumCommandsExecuted()
public int getOsType()
public java.lang.String getOsDescription()
Copyright © 2021. All rights reserved.