public abstract class SshClientUtils extends Object
| 构造器和说明 |
|---|
SshClientUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
download(ch.ethz.ssh2.Connection connection,
String path)
SFTP下载文件
|
static String |
execute(ch.ethz.ssh2.Connection connection,
String command)
执行SSH命令
|
static ch.ethz.ssh2.Connection |
getConnection(SshAccount account)
获取Connection
|
static List<String> |
listNames(ch.ethz.ssh2.Connection connection,
String path)
SFTP名称列表
|
static void |
upLoad(ch.ethz.ssh2.Connection connection,
byte[] input,
String path)
SFTP上传文件
|
static void |
upLoad(ch.ethz.ssh2.Connection connection,
File file,
String path)
SFTP上传文件
|
static void |
upLoad(ch.ethz.ssh2.Connection connection,
InputStream input,
String path)
SFTP上传文件
|
public static ch.ethz.ssh2.Connection getConnection(SshAccount account)
account - 账号public static String execute(ch.ethz.ssh2.Connection connection, String command)
connection - SSH连接command - SSH命令public static void upLoad(ch.ethz.ssh2.Connection connection,
File file,
String path)
connection - SSH连接file - 文件path - 远程路径public static void upLoad(ch.ethz.ssh2.Connection connection,
byte[] input,
String path)
connection - SSH连接input - 文件流path - 远程路径public static void upLoad(ch.ethz.ssh2.Connection connection,
InputStream input,
String path)
connection - SSH连接input - 文件流path - 远程路径public static byte[] download(ch.ethz.ssh2.Connection connection,
String path)
connection - SSH连接path - 远程路径Copyright © 2019 Pivotal Software, Inc.. All rights reserved.