I'm writing a Jenkins plugin and i'm using build.getWorkspace()
to get the path to the current workspace. The issue is that this returns a FilePath object.
How can i convert this to a File object?
A valid file URI must therefore begin with either file:/path (no hostname), file:///path (empty hostname), or file://hostname/path . file://path (i.e. two slashes, without a hostname) is never correct, but is often used.
Although I haven't tried this, according to the javadoc you can obtain the URI from which you can then create a file: File myFile = new File(build.getWorkspace().toURI())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With