提交 a1fe8ccd 编写于 作者: K Kohsuke Kawaguchi

added a convenience method

上级 19545afd
......@@ -303,6 +303,27 @@ public abstract class CLICommand implements ExtensionPoint, Cloneable {
private static final long serialVersionUID = 1L;
}
/**
* Convenience method for subtypes to obtain environment variables of the client.
*/
protected String getClientEnvironmentVariable(String name) throws IOException, InterruptedException {
return channel.call(new GetEnvironmentVariable(name));
}
private static final class GetEnvironmentVariable implements Callable<String, IOException> {
private final String name;
private GetEnvironmentVariable(String name) {
this.name = name;
}
public String call() throws IOException {
return System.getenv(name);
}
private static final long serialVersionUID = 1L;
}
/**
* Creates a clone to be used to execute a command.
*/
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册