You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/02/10 14:34:29 UTC
[commons-io] 01/02: Minor and tweaked refactoring from
https://github.com/apache/commons-io/pull/203 by Andrew Shcheglov
(ashcheglov on GitHub).
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
commit 91e2c95b2c7d9b6f23c08b871c5cea7d4d950941
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Wed Feb 10 09:16:24 2021 -0500
Minor and tweaked refactoring from
https://github.com/apache/commons-io/pull/203 by Andrew Shcheglov
(ashcheglov on GitHub).
---
src/main/java/org/apache/commons/io/file/PathUtils.java | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/commons/io/file/PathUtils.java b/src/main/java/org/apache/commons/io/file/PathUtils.java
index 5d15251..8ff6dbd 100644
--- a/src/main/java/org/apache/commons/io/file/PathUtils.java
+++ b/src/main/java/org/apache/commons/io/file/PathUtils.java
@@ -226,9 +226,10 @@ public final class PathUtils {
*/
public static PathCounters copyDirectory(final Path sourceDirectory, final Path targetDirectory,
final CopyOption... copyOptions) throws IOException {
+ final Path absoluteSource = sourceDirectory.toAbsolutePath();
return visitFileTree(
- new CopyDirectoryVisitor(Counters.longPathCounters(), sourceDirectory, targetDirectory, copyOptions),
- sourceDirectory).getPathCounters();
+ new CopyDirectoryVisitor(Counters.longPathCounters(), absoluteSource, targetDirectory, copyOptions),
+ absoluteSource).getPathCounters();
}
/**