public class OpenSshConfig extends Object implements com.jcraft.jsch.ConfigRepository
JSch does have its own config file parser
OpenSSHConfig
since version 0.1.50, but it has a
number of problems:
This parser makes the critical options available to
SshSessionFactory
via
OpenSshConfig.Host
objects returned by
lookup(String)
, and implements a fully conforming
ConfigRepository
providing
ConfigRepository.Config
s via
getConfig(String)
.
OpenSshConfigFile
Modifier and Type | Class and Description |
---|---|
static class |
OpenSshConfig.Host
Configuration of one "Host" block in the configuration file.
|
Modifier and Type | Method and Description |
---|---|
static OpenSshConfig |
get(FS fs)
Obtain the user's configuration data.
|
com.jcraft.jsch.ConfigRepository.Config |
getConfig(String hostName) |
OpenSshConfig.Host |
lookup(String hostName)
Locate the configuration for a specific host request.
|
String |
toString() |
public static OpenSshConfig get(FS fs)
The configuration file is always returned to the caller, even if no file exists in the user's home directory at the time the call was made. Lookup requests are cached and are automatically updated if the user modifies the configuration file since the last time it was cached.
fs
- the file system abstraction which will be necessary to
perform certain file system operations.public OpenSshConfig.Host lookup(String hostName)
hostName
- the name the user has supplied to the SSH tool. This may be a
real host name, or it may just be a "Host" block in the
configuration file.public com.jcraft.jsch.ConfigRepository.Config getConfig(String hostName)
Retrieves the full Config
for the given host name. Should be called only by Jsch and tests.
getConfig
in interface com.jcraft.jsch.ConfigRepository
Copyright © 2020 Eclipse JGit Project. All rights reserved.