Oracle's Java 7 release introduced NIO.2, which extends its NIO (New I/O) framework with new capabilities (e.g., the ability to work with symbolic/soft links and hard links). This post launches a three-part series in which I present a cookbook of recipes for accomplishing various tasks with NIO.2.
Copying Files
Q: How do I copy a file to another file?
A: You copy a file to another file by using the java.nio.file.Files class's public static Path copy(Path source, Path target, CopyOption... options) method, which copies a source file to a target file.