public class JschConfigSessionFactory extends SshSessionFactory
$HOME/.ssh.
This is the default implementation used by JGit and provides most of the compatibility necessary to match OpenSSH, a popular implementation of SSH used by C Git.
The factory does not provide UI behavior. Override the method
configure(org.eclipse.jgit.transport.OpenSshConfig.Host, Session) to
supply appropriate UserInfo to the session.
| Constructor and Description |
|---|
JschConfigSessionFactory() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
configure(OpenSshConfig.Host hc,
com.jcraft.jsch.Session session)
Provide additional configuration for the session based on the host
information.
|
protected void |
configureJSch(com.jcraft.jsch.JSch jsch)
Provide additional configuration for the JSch instance.
|
protected com.jcraft.jsch.JSch |
createDefaultJSch(FS fs)
Create default instance of jsch
|
protected com.jcraft.jsch.Session |
createSession(OpenSshConfig.Host hc,
String user,
String host,
int port,
FS fs)
Create a new remote session for the requested address.
|
protected com.jcraft.jsch.JSch |
getJSch(OpenSshConfig.Host hc,
FS fs)
Obtain the JSch used to create new sessions.
|
RemoteSession |
getSession(URIish uri,
CredentialsProvider credentialsProvider,
FS fs,
int tms) |
String |
getType() |
getInstance, getLocalUserName, releaseSession, setInstancepublic RemoteSession getSession(URIish uri, CredentialsProvider credentialsProvider, FS fs, int tms) throws TransportException
getSession in class SshSessionFactoryTransportExceptionpublic String getType()
getType in class SshSessionFactoryprotected com.jcraft.jsch.Session createSession(OpenSshConfig.Host hc, String user, String host, int port, FS fs) throws com.jcraft.jsch.JSchException
hc - host configurationuser - login to authenticate as.host - server name to connect to.port - port number of the SSH daemon (typically 22).fs - the file system abstraction which will be necessary to
perform certain file system operations.com.jcraft.jsch.JSchException - the session could not be created.protected void configureJSch(com.jcraft.jsch.JSch jsch)
IdentityRepository.jsch - jsch instanceprotected void configure(OpenSshConfig.Host hc, com.jcraft.jsch.Session session)
UserInfo.hc - host configurationsession - session to configureprotected com.jcraft.jsch.JSch getJSch(OpenSshConfig.Host hc, FS fs) throws com.jcraft.jsch.JSchException
hc - host configurationfs - the file system abstraction which will be necessary to
perform certain file system operations.com.jcraft.jsch.JSchException - the user configuration could not be created.protected com.jcraft.jsch.JSch createDefaultJSch(FS fs) throws com.jcraft.jsch.JSchException
fs - the file system abstraction which will be necessary to perform
certain file system operations.com.jcraft.jsch.JSchException - known host keys cannot be loaded.Copyright © 2020 Eclipse JGit Project. All rights reserved.