Replaced custom copyFile() with Java NIO Files.copy() method.