public class SshdSession extends Object implements RemoteSession
RemoteSession
based on Apache MINA sshd.Modifier and Type | Method and Description |
---|---|
void |
addCloseListener(SessionCloseListener listener)
Adds a
SessionCloseListener to this session. |
void |
disconnect()
Disconnect the remote session
|
Process |
exec(String commandName,
int timeout)
Generate a new remote process to execute the given command.
|
FtpChannel |
getFtpChannel()
Obtain an
FtpChannel to perform SFTP operations in this
SshdSession . |
void |
removeCloseListener(SessionCloseListener listener)
Removes the given
listener ; has no effect if the listener is not
currently registered with this session. |
public void addCloseListener(@NonNull SessionCloseListener listener)
SessionCloseListener
to this session. Has no effect if the
given listener
is already registered with this session.listener
- to addpublic void removeCloseListener(@NonNull SessionCloseListener listener)
listener
; has no effect if the listener is not
currently registered with this session.listener
- to removepublic Process exec(String commandName, int timeout) throws IOException
RemoteSession
exec
in interface RemoteSession
commandName
- command to executetimeout
- timeout value, in seconds, for command executionIOException
- may be thrown in several cases. For example, on problems
opening input or output streams or on problems connecting or
communicating with the remote host. For the latter two cases,
a TransportException may be thrown (a subclass of
java.io.IOException).@NonNull public FtpChannel getFtpChannel()
FtpChannel
to perform SFTP operations in this
SshdSession
.getFtpChannel
in interface RemoteSession
FtpChannel
public void disconnect()
RemoteSession
disconnect
in interface RemoteSession
Copyright © 2020 Eclipse JGit Project. All rights reserved.