Skip to content

Commit 91e2c95

Browse files
author
Gary Gregory
committed
Minor and tweaked refactoring from
#203 by Andrew Shcheglov (ashcheglov on GitHub).
1 parent 2d7fef1 commit 91e2c95

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/org/apache/commons/io/file/PathUtils.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,10 @@ public static PathCounters cleanDirectory(final Path directory, final DeleteOpti
226226
*/
227227
public static PathCounters copyDirectory(final Path sourceDirectory, final Path targetDirectory,
228228
final CopyOption... copyOptions) throws IOException {
229+
final Path absoluteSource = sourceDirectory.toAbsolutePath();
229230
return visitFileTree(
230-
new CopyDirectoryVisitor(Counters.longPathCounters(), sourceDirectory, targetDirectory, copyOptions),
231-
sourceDirectory).getPathCounters();
231+
new CopyDirectoryVisitor(Counters.longPathCounters(), absoluteSource, targetDirectory, copyOptions),
232+
absoluteSource).getPathCounters();
232233
}
233234

234235
/**

0 commit comments

Comments
 (0)