You want to use FilePath class as much as possible, it has methods that 
work regardless if it is on master or agent.

See the JavaDoc: https://javadoc.jenkins.io/hudson/FilePath.html


On Tuesday, February 26, 2019 at 8:44:02 AM UTC+1, Nikhil Bhoski wrote:
>
> I have my plugin which creates a file in the jenkins workspace. however if 
> i configure slave and force the job to run on slave then i see file on 
> slave is not getting created. 
>
> I am using workspace.getRemote() to get the workspace path and Java 
> File.copy() utility to copy the file in workspace.getRemote() path . 
> However the file is not getting created on slave. Any suggestions to make 
> it work ?
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/1e0a992a-6528-4f15-8399-e8ce0befb66f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to