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) |
ExpectShell(java.io.InputStream in,
java.io.OutputStream out,
ExpectShell parentShell) |
| 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 SshException, java.io.IOException, ShellTimeoutException
SshExceptionjava.io.IOExceptionShellTimeoutExceptionpublic ExpectShell(AbstractSessionTask<SessionChannelNG> session, ShellStartupTrigger trigger) throws SshException, java.io.IOException, ShellTimeoutException
SshExceptionjava.io.IOExceptionShellTimeoutExceptionpublic ExpectShell(AbstractSessionTask<SessionChannelNG> session, ShellStartupTrigger trigger, long startupTimeout) throws SshException, java.io.IOException, ShellTimeoutException
SshExceptionjava.io.IOExceptionShellTimeoutExceptionpublic ExpectShell(AbstractSessionTask<SessionChannelNG> session, ShellStartupTrigger trigger, long startupTimeout, java.lang.String termtype) throws SshException, java.io.IOException, ShellTimeoutException
SshExceptionjava.io.IOExceptionShellTimeoutExceptionpublic ExpectShell(AbstractSessionTask<SessionChannelNG> session, ShellStartupTrigger trigger, long startupTimeout, java.lang.String termtype, int cols, int rows) throws SshException, java.io.IOException, ShellTimeoutException
SshExceptionjava.io.IOExceptionShellTimeoutExceptionpublic ExpectShell(java.io.InputStream in,
java.io.OutputStream out,
ExpectShell parentShell)
throws SshIOException,
SshException,
java.io.IOException,
ShellTimeoutException
SshIOExceptionSshExceptionjava.io.IOExceptionShellTimeoutExceptionpublic 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 SshIOException, SshException, java.io.IOException, ShellTimeoutException
SshIOExceptionSshExceptionjava.io.IOExceptionShellTimeoutExceptionpublic ExpectShell su(java.lang.String cmd, java.lang.String password, java.lang.String promptExpression) throws SshException, SshIOException, java.io.IOException, ShellTimeoutException
SshExceptionSshIOExceptionjava.io.IOExceptionShellTimeoutExceptionpublic ExpectShell su(java.lang.String cmd) throws SshException, SshIOException, java.io.IOException, ShellTimeoutException
SshExceptionSshIOExceptionjava.io.IOExceptionShellTimeoutExceptionpublic ExpectShell su(java.lang.String cmd, java.lang.String password, java.lang.String promptExpression, ShellMatcher matcher) throws SshException, SshIOException, java.io.IOException, ShellTimeoutException
SshExceptionSshIOExceptionjava.io.IOExceptionShellTimeoutExceptionpublic ShellProcess sudo(java.lang.String cmd, java.lang.String password) throws SshException, ShellTimeoutException, java.io.IOException
SshExceptionShellTimeoutExceptionjava.io.IOExceptionpublic ShellProcess sudo(java.lang.String cmd, java.lang.String password, java.lang.String promptExpression) throws SshException, ShellTimeoutException, java.io.IOException
SshExceptionShellTimeoutExceptionjava.io.IOExceptionpublic ShellProcess sudo(java.lang.String cmd, java.lang.String password, java.lang.String promptExpression, ShellMatcher matcher) throws SshException, ShellTimeoutException, java.io.IOException
SshExceptionShellTimeoutExceptionjava.io.IOExceptionpublic boolean isClosed()
public void exit()
throws java.io.IOException,
SshException
java.io.IOExceptionSshExceptionpublic void close()
throws java.io.IOException,
SshException
java.io.IOExceptionSshExceptionpublic java.lang.String getNewline()
public void execute(java.lang.String cmd)
throws SshException
SshExceptionpublic ShellProcess executeCommand(java.lang.String origCmd) throws SshException
SshExceptionpublic ShellProcess executeCommand(java.lang.String origCmd, boolean consume) throws SshException
SshExceptionpublic ShellProcess executeCommand(java.lang.String origCmd, java.lang.String charset) throws SshException
SshExceptionpublic ShellProcess executeCommand(java.lang.String origCmd, boolean consume, java.lang.String charset) throws SshException
SshExceptionpublic ShellProcess executeCommand(java.lang.String origCmd, boolean matchPromptMarker, boolean consume) throws SshException
SshExceptionpublic ShellProcess executeCommand(java.lang.String origCmd, boolean matchPromptMarker, boolean consume, java.lang.String charset) throws SshException
SshExceptionpublic int getNumCommandsExecuted()
public int getOsType()
public java.lang.String getOsDescription()
Copyright © 2022. All rights reserved.