mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-07 09:06:03 +00:00
added a convenience method
This commit is contained in:
1 parent
cae8c5f2ef
commit
c462cb634c
1 file changed
+12
@@ -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")));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user