public final class SftpClientFactory
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
SftpClientFactory.JSchLogger
Interface JSchLogger with JCL.
|
Modifier and Type | Field and Description |
---|---|
private static org.apache.commons.logging.Log |
LOG |
private static java.lang.String |
OPENSSH_CONFIG_NAME |
private static java.lang.String |
SSH_DIR_NAME |
Modifier | Constructor and Description |
---|---|
private |
SftpClientFactory() |
Modifier and Type | Method and Description |
---|---|
private static void |
addIdentities(com.jcraft.jsch.JSch jsch,
java.io.File sshDir,
IdentityProvider[] identities) |
private static void |
addIdentity(com.jcraft.jsch.JSch jsch,
IdentityProvider identity) |
static com.jcraft.jsch.Session |
createConnection(java.lang.String hostname,
int port,
char[] username,
char[] password,
FileSystemOptions fileSystemOptions)
Creates a new connection to the server.
|
private static com.jcraft.jsch.ProxyHTTP |
createProxyHTTP(java.lang.String proxyHost,
int proxyPort) |
private static com.jcraft.jsch.ProxySOCKS5 |
createProxySOCKS5(java.lang.String proxyHost,
int proxyPort) |
private static com.jcraft.jsch.Proxy |
createStreamProxy(java.lang.String proxyHost,
int proxyPort,
FileSystemOptions fileSystemOptions,
SftpFileSystemConfigBuilder builder) |
private static java.io.File |
findSshDir()
Finds the
.ssh directory. |
private static void |
setConfigRepository(com.jcraft.jsch.JSch jsch,
java.io.File sshDir,
com.jcraft.jsch.ConfigRepository configRepository,
boolean loadOpenSSHConfig) |
private static void |
setKnownHosts(com.jcraft.jsch.JSch jsch,
java.io.File sshDir,
java.io.File knownHostsFile) |
private static final java.lang.String SSH_DIR_NAME
private static final java.lang.String OPENSSH_CONFIG_NAME
private static final org.apache.commons.logging.Log LOG
public static com.jcraft.jsch.Session createConnection(java.lang.String hostname, int port, char[] username, char[] password, FileSystemOptions fileSystemOptions) throws FileSystemException
hostname
- The name of the host to connect to.port
- The port to use.username
- The user's id.password
- The user's password.fileSystemOptions
- The FileSystem options.FileSystemException
- if an error occurs.private static void addIdentities(com.jcraft.jsch.JSch jsch, java.io.File sshDir, IdentityProvider[] identities) throws FileSystemException
FileSystemException
private static void setConfigRepository(com.jcraft.jsch.JSch jsch, java.io.File sshDir, com.jcraft.jsch.ConfigRepository configRepository, boolean loadOpenSSHConfig) throws FileSystemException
FileSystemException
private static void addIdentity(com.jcraft.jsch.JSch jsch, IdentityProvider identity) throws FileSystemException
FileSystemException
private static void setKnownHosts(com.jcraft.jsch.JSch jsch, java.io.File sshDir, java.io.File knownHostsFile) throws FileSystemException
FileSystemException
private static com.jcraft.jsch.Proxy createStreamProxy(java.lang.String proxyHost, int proxyPort, FileSystemOptions fileSystemOptions, SftpFileSystemConfigBuilder builder)
private static com.jcraft.jsch.ProxySOCKS5 createProxySOCKS5(java.lang.String proxyHost, int proxyPort)
private static com.jcraft.jsch.ProxyHTTP createProxyHTTP(java.lang.String proxyHost, int proxyPort)
private static java.io.File findSshDir()
.ssh
directory.
The lookup order is:
vfs.sftp.sshdir
(the override mechanism)user.home
/.sshC:\cygwin\home[user.name]\.ssh
The default installation directory for Cygwin is C:\cygwin
. On my set up (Gary here), I have Cygwin in
C:\bin\cygwin
, not the default. Also, my .ssh directory was created in the user.home
directory.
.ssh
directory