Check out example codes for "Java how to copy file". It will help you in understanding the concepts better.

Code Example 1

var source = new File("src/resources/bugs.txt");
var dest = new File("src/resources/bugs2.txt");

Files.copy(source.toPath(), dest.toPath(), 
           StandardCopyOption.REPLACE_EXISTING);

//Source: http://zetcode.com/java/copyfile/

Learn ReactJs, React Native from akashmittal.com