public class SessionStore extends Object implements SafeCloseable
Modifier and Type | Field and Description |
---|---|
protected com.jcraft.jsch.Session |
session
session
|
Constructor and Description |
---|
SessionStore(com.jcraft.jsch.Session session) |
public SessionStore config(String key, String value)
key
- keyvalue
- valuepublic SessionStore password(String password)
password
- 密码public SessionStore password(byte[] password)
password
- 密码public SessionStore httpProxy(String host, int port)
public SessionStore httpProxy(String host, int port, String username, String password)
public SessionStore socks4Proxy(String host, int port)
public SessionStore socks4Proxy(String host, int port, String username, String password)
public SessionStore socks5Proxy(String host, int port)
public SessionStore socks5Proxy(String host, int port, String username, String password)
public SessionStore proxy(SessionProxyType type, String host, int port)
public SessionStore proxy(SessionProxyType type, String host, int port, String username, String password)
type
- 代理类型host
- 代理地址port
- 代理端口username
- 代理用户名password
- 代理密码public SessionStore clientVersion(String version)
version
- 版本public SessionStore daemonThread(boolean daemon)
daemon
- true守护进程public void setConfig(String key, String value)
key
- keyvalue
- valuepublic SessionStore timeout(int timeout)
timeout
- 超时时间public SessionStore connect()
public SessionStore connect(int timeout)
timeout
- 超时时间public CommandExecutor getCommandExecutor(String command)
public CommandExecutor getCommandExecutor(String command, String charset)
public CommandExecutor getCommandExecutor(byte[] command)
command
- 命令public ShellExecutor getShellExecutor()
public SftpExecutor getSftpExecutor()
public SftpExecutor getSftpExecutor(String fileNameCharset)
fileNameCharset
- 文件名称编码public void disconnect()
public boolean isConnected()
public com.jcraft.jsch.Session getSession()
public String getHost()
public void setHost(String host)
public int getPort()
public void setPort(int port)
public String getUsername()
public void close()
SafeCloseable
close
in interface SafeCloseable
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2024. All rights reserved.