Java tutorial
import static java.nio.file.LinkOption.NOFOLLOW_LINKS; import static java.nio.file.StandardCopyOption.COPY_ATTRIBUTES; import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; public class Main { public static void main(String[] args) { Path copy_from_1 = Paths.get("C:/tutorial/Java/JavaFX", "tutor.txt"); Path copy_to_1 = Paths.get("C:/tutorial/Java/USOpen", copy_from_1.getFileName().toString()); try { Files.copy(copy_from_1, copy_to_1, REPLACE_EXISTING, COPY_ATTRIBUTES, NOFOLLOW_LINKS); } catch (IOException e) { System.err.println(e); } } }