Skip to content

Commit bd0d6f4

Browse files
author
Andrey Shcheglov
committed
IO-719: copied comment
1 parent 54e8c97 commit bd0d6f4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ public FileVisitResult preVisitDirectory(final Path directory, final BasicFileAt
155155

156156
@Override
157157
public FileVisitResult visitFile(final Path sourceFile, final BasicFileAttributes attributes) throws IOException {
158+
// We have to stringize relative value because we cannot use paths belonging to different filesystems
159+
// in the Path methods (usually this leads to ProviderMismatchException)
158160
final Path targetFile = targetDirectory.resolve(sourceDirectory.relativize(sourceFile).toString());
159161
copy(sourceFile, targetFile);
160162
return super.visitFile(targetFile, attributes);

0 commit comments

Comments
 (0)