- java.lang.Object
-
- org.eclipse.jgit.transport.ssh.jsch.JschSession
-
- All Implemented Interfaces:
RemoteSession,RemoteSession2
public class JschSession extends Object implements RemoteSession2
Run remote commands using Jsch.This class is the default session implementation using Jsch. Note that
JschConfigSessionFactoryis used to create the actual session passed to the constructor.- Since:
- 6.0
-
-
Constructor Summary
Constructors Constructor Description JschSession(com.jcraft.jsch.Session session, URIish uri)Create a new session object by passing the real Jsch session and the URI information.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voiddisconnect()Processexec(String command, int timeout)Processexec(String command, Map<String,String> environment, int timeout)FtpChannelgetFtpChannel()com.jcraft.jsch.ChannelgetSftpChannel()Deprecated.since 5.2; usegetFtpChannel()instead
-
-
-
Constructor Detail
-
JschSession
public JschSession(com.jcraft.jsch.Session session, URIish uri)Create a new session object by passing the real Jsch session and the URI information.- Parameters:
session- the real Jsch session created elsewhere.uri- the URI information for the remote connection
-
-
Method Detail
-
exec
public Process exec(String command, int timeout) throws IOException
- Specified by:
execin interfaceRemoteSession- Throws:
IOException
-
exec
public Process exec(String command, Map<String,String> environment, int timeout) throws IOException
- Specified by:
execin interfaceRemoteSession2- Throws:
IOException
-
disconnect
public void disconnect()
- Specified by:
disconnectin interfaceRemoteSession
-
getSftpChannel
@Deprecated public com.jcraft.jsch.Channel getSftpChannel() throws com.jcraft.jsch.JSchException
Deprecated.since 5.2; usegetFtpChannel()insteadA kludge to allowTransportSftpto get an Sftp channel from Jsch. Ideally, this method would be generic, which would require implementing generic Sftp channel operations in the RemoteSession class.- Returns:
- a channel suitable for Sftp operations.
- Throws:
com.jcraft.jsch.JSchException- on problems getting the channel.
-
getFtpChannel
public FtpChannel getFtpChannel()
- Specified by:
getFtpChannelin interfaceRemoteSession- Since:
- 5.2
-
-