public class RuntimeGenerate extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private String |
command
指令
|
private List<String> |
commands
指令
|
private File |
dir
子进程的工作目录,如果子进程应该继承当前进程的工作目录,则该参数为 null
|
private Map<String,String> |
envp
环境变量
|
private boolean |
isWait
是否等待,默认 false
|
private static org.slf4j.Logger |
logger |
| 构造器和说明 |
|---|
RuntimeGenerate() |
| 限定符和类型 | 方法和说明 |
|---|---|
static RuntimeGenerate |
build() |
RuntimeGenerate |
command(String command) |
RuntimeGenerate |
commands(List<String> commands) |
RuntimeGenerate |
dir(File dir)
子进程的工作目录,如果子进程应该继承当前进程的工作目录,则该参数为 null
|
RuntimeGenerate |
envp(Map<String,String> envp)
设置环境变量
|
RuntimeGenerate |
envp(String key,
String value)
设置环境变量
|
R |
exec()
执行指令
|
R |
exec(List<String> commands)
执行指令
|
R |
exec(String... commands)
执行指令
|
R |
exec(String command)
执行指令
|
private String[] |
toEnvp()
字符串数组,其中每个元素的环境变量的设置格式为 name=value,如果子进程应该继承当前进程的环境,或该参数为 null
|
RuntimeGenerate |
wait(boolean wait)
是否等待
|
private static org.slf4j.Logger logger
private String command
private boolean isWait
private File dir
public static RuntimeGenerate build()
public R exec()
public RuntimeGenerate command(String command)
public RuntimeGenerate commands(List<String> commands)
public RuntimeGenerate wait(boolean wait)
wait - 是否等待public RuntimeGenerate envp(Map<String,String> envp)
envp - 环境变量public RuntimeGenerate envp(String key, String value)
key - 变量keyvalue - 变量valueprivate String[] toEnvp()
public RuntimeGenerate dir(File dir)
Copyright © 2025. All rights reserved.