ShellAvailableHostMachine

可以执行 shell 命令的宿主机

Functions

Link copied to clipboard
abstract fun createFile(path: String, content: String?)

创建文件, 若文件已经存在,则会覆盖

Link copied to clipboard
abstract fun createInteractiveShell(vararg command: String): InteractiveShell

创建一个交互式的连接.

Link copied to clipboard
abstract fun download(url: String, destPath: String)

将指定文件下载到文件夹中

Link copied to clipboard
abstract fun env(name: String): String?

获取环境变量

Link copied to clipboard
abstract fun execute(vararg command: String): CommandExecuteResult

执行一条命令

Link copied to clipboard

获取连接配置

Link copied to clipboard
abstract fun getHostMachine(): HostMachine

获取宿主机

Link copied to clipboard

获取配置

Link copied to clipboard
abstract fun getOS(): OS

获取操作系统类型

Link copied to clipboard
abstract fun grep(searchChain: Array<String>, vararg commands: String): CommandExecuteResult

多次过滤

abstract fun grep(search: String, vararg commands: String): CommandExecuteResult

过滤输出

Link copied to clipboard
abstract fun isArm(): Boolean

是否为 arm 架构

Link copied to clipboard
abstract fun isDirectoryExist(path: String): Boolean

文件夹是否存在

Link copied to clipboard
Link copied to clipboard
abstract fun isFileNotExist(path: String): Boolean

文件是否存在

Link copied to clipboard
abstract fun listFiles(directory: String): List<String>

列出所有文件

Link copied to clipboard
abstract fun mkdirs(path: String)

递归创建文件夹

Link copied to clipboard
abstract fun mv(src: String, dest: String, recursive: Boolean)

移动文件

Link copied to clipboard

生成默认的数据文件夹

Link copied to clipboard
abstract fun test()

测试连接

Link copied to clipboard
abstract fun transferFile(src: String, dest: String, indicator: <Error class: unknown class>?)

将本地的文件发送到宿主机上面

Link copied to clipboard
abstract fun tryUnzip(target: String, destDir: String): Boolean

尝试使用系统本地工具库来解压压缩包(zip, tar.gz, tgz...)