public class OpenSSHConfig
extends java.lang.Object
implements com.jcraft.jsch.ConfigRepository
Modifier and Type | Class and Description |
---|---|
private static class |
OpenSSHConfig.HostConfig |
private static class |
OpenSSHConfig.OpenSSHArgument
Parses and stores an argument of an OpenSSH config file.
|
Modifier and Type | Field and Description |
---|---|
private static java.util.regex.Pattern |
DELIMITER_PATTERN |
private java.util.List<OpenSSHConfig.OpenSSHArgument> |
sshArguments |
private static java.util.regex.Pattern |
WILDCARD_PATTERN
Matches text without wildcards, or, individual wildcards.
|
Constructor and Description |
---|
OpenSSHConfig(java.io.Reader in)
Parses an OpenSSH config from a Reader.
|
Modifier and Type | Method and Description |
---|---|
com.jcraft.jsch.ConfigRepository.Config |
getConfig(java.lang.String host) |
static OpenSSHConfig |
parse(java.io.File file)
Parses the given file, and returns an instance of ConfigRepository.
|
static OpenSSHConfig |
parse(java.lang.String conf)
Parses the given string, and returns an instance of ConfigRepository.
|
private static java.util.List<OpenSSHConfig.OpenSSHArgument> |
tokenize(java.io.Reader in) |
protected static java.util.regex.Pattern |
wildcardToPattern(java.lang.String wildcard) |
private static final java.util.regex.Pattern DELIMITER_PATTERN
private static final java.util.regex.Pattern WILDCARD_PATTERN
private final java.util.List<OpenSSHConfig.OpenSSHArgument> sshArguments
public OpenSSHConfig(java.io.Reader in) throws java.io.IOException, XenonException
in
- Reader of the OpenSSH configjava.io.IOException
- if the Reader cannot be read.XenonException
- if the configuration file is malformedpublic static OpenSSHConfig parse(java.lang.String conf) throws XenonException
conf
- string of an OpenSSH configXenonException
- if the configuration file is malformedpublic static OpenSSHConfig parse(java.io.File file) throws java.io.IOException, XenonException
file
- OpenSSH's config filejava.io.IOException
- if the file cannot be readXenonException
- if the configuration file is malformedprotected static java.util.regex.Pattern wildcardToPattern(java.lang.String wildcard)
private static java.util.List<OpenSSHConfig.OpenSSHArgument> tokenize(java.io.Reader in) throws java.io.IOException, XenonException
java.io.IOException
XenonException
public com.jcraft.jsch.ConfigRepository.Config getConfig(java.lang.String host)
getConfig
in interface com.jcraft.jsch.ConfigRepository