'How I can copy files from one remote workspace to master machine in jenkins pipeline?

I have created one jenkins pipeline in which I am running 4 jobs on four slave machine, it creates four workspaces on all 4 slave machines ,once the execution will be completed ,I want to copy some files from the slave workspaces to master workspace or master machine . Please help me to figure out the solution for the same.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source