[
https://issues.apache.org/jira/browse/IO-719?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17281360#comment-17281360
]
Gary D. Gregory commented on IO-719:
------------------------------------
The JRE provides multiple file systems IIRC: file and zip. Why not test with
those? I would expect a test using those two to at least show that the problem
is not specific to jimfs. If you can show a failing test with zip and file then
we can consider a fix. At that point we could consider additional tests with
jimfs but it might not be needed.
> PathUtils.copyDirectory() does not work when source and dest belong to
> different filesystems
> --------------------------------------------------------------------------------------------
>
> Key: IO-719
> URL: https://issues.apache.org/jira/browse/IO-719
> Project: Commons IO
> Issue Type: Bug
> Components: Utilities
> Affects Versions: 2.8.0
> Environment: Java 8, Linux
> Reporter: Andrew Shcheglov
> Priority: Major
>
> This code:
> {code:java}
> @Test
> public void pathUtilsCopyDirFailure() throws IOException {
> FileSystem fs1 = Jimfs.newFileSystem();
> Path srcDir = fs1.getPath("srcDir");
> // Create files/dirs in srcDir
> Path targetDir = Paths.get("targetDir");
> PathUtils.copyDirectory(srcDir, targetDir);
> }
> {code}
> throws exception:
> {noformat}
> java.nio.file.ProviderMismatchException
> at java.base/sun.nio.fs.UnixPath.toUnixPath(UnixPath.java:198)
> at java.base/sun.nio.fs.UnixPath.resolve(UnixPath.java:410)
> at java.base/sun.nio.fs.UnixPath.resolve(UnixPath.java:43)
> at
> org.apache.commons.io.file.CopyDirectoryVisitor.preVisitDirectory(CopyDirectoryVisitor.java:130)
> at
> org.apache.commons.io.file.CopyDirectoryVisitor.preVisitDirectory(CopyDirectoryVisitor.java:36)
> at java.base/java.nio.file.Files.walkFileTree(Files.java:2731)
> at java.base/java.nio.file.Files.walkFileTree(Files.java:2796)
> at
> org.apache.commons.io.file.PathUtils.visitFileTree(PathUtils.java:687)
> at
> org.apache.commons.io.file.PathUtils.copyDirectory(PathUtils.java:196)
> {noformat}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)