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

added a convenience method

上级 cae8c5f2
......@@ -2450,4 +2450,16 @@ public final class FilePath implements Serializable {
throw new AssertionError(e);
}
}
/**
* Gets the {@link FilePath} representation of the "~" directory
* (User's home directory in the Unix sense) of the given channel.
*/
public static FilePath getHomeDirectory(VirtualChannel ch) throws InterruptedException, IOException {
ch.call(new Callable<FilePath,IOException>() {
public FilePath call() throws IOException {
return new FilePath(new File(System.getProperty("user.home")));
}
});
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册