[IO-807] Copy symlinks, not the files the symlinks point to #558

- Use diamond notation
- Reuse PathUtils.EMPTY_COPY_OPTIONS
- Refactor calls to toPath()
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index cd8fdcd..3c7d293 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -91,6 +91,7 @@
       <action dev="ggregory" type="fix" due-to="Sylwester Lachiewicz, Gary Gregory">XmlStreamReader can't parse an XML document with a multi-line prolog #550.</action>
       <action dev="ggregory" type="fix" due-to="Andreas Hubold, Gary Gregory">XmlStreamReader can't parse XML an document with an external parsed entity prolog.</action>
       <action dev="ggregory" type="fix" issue="IO-836" due-to="Elliotte Rusty Harold">Update FileNameUtils Javadoc #554.</action>
+      <action dev="ggregory" type="fix" issue="IO-807" due-to="Jordi Sola, Elliotte Rusty Harold">Copy symlinks, not the files the symlinks point to #558.</action>
       <!-- Add -->
       <action dev="ggregory" type="add"                due-to="Gary Gregory">Add and use PathUtils.getFileName(Path, Function&lt;Path, R&gt;).</action>
       <action dev="ggregory" type="add"                due-to="Gary Gregory">Add and use PathUtils.getFileNameString().</action>
diff --git a/src/main/java/org/apache/commons/io/FileUtils.java b/src/main/java/org/apache/commons/io/FileUtils.java
index 5a26fc2..d2e17d6 100644
--- a/src/main/java/org/apache/commons/io/FileUtils.java
+++ b/src/main/java/org/apache/commons/io/FileUtils.java
@@ -845,14 +845,15 @@
             requireCanWrite(destFile, "destFile");
         }
 
-        final boolean isSymLink = Files.isSymbolicLink(srcFile.toPath());
+        final Path srcPath = srcFile.toPath();
+        final boolean isSymLink = Files.isSymbolicLink(srcPath);
         if (isSymLink && !Arrays.asList(copyOptions).contains(LinkOption.NOFOLLOW_LINKS)) {
-            final List<CopyOption> list = new ArrayList<CopyOption>(Arrays.asList(copyOptions));
+            final List<CopyOption> list = new ArrayList<>(Arrays.asList(copyOptions));
             list.add(LinkOption.NOFOLLOW_LINKS);
-            copyOptions = list.toArray(new CopyOption[0]);
+            copyOptions = list.toArray(PathUtils.EMPTY_COPY_OPTIONS);
         }
 
-        Files.copy(srcFile.toPath(), destFile.toPath(), copyOptions);
+        Files.copy(srcPath, destFile.toPath(), copyOptions);
 
         // On Windows, the last modified time is copied by default.
         if (preserveFileDate && !isSymLink && !setTimes(srcFile, destFile)) {