在不同文件系统之间复制目录内容的干净方法?

Kon*_*zik 5 java filesystems path jvm-languages

我想将文件从一个复制java.nio.file.FileSystem到另一个。例如,从默认文件系统到com.google.common.jimfs.Jimfs.

Puc*_*uce 3

我已经为此用例编写了一些实用程序类。该库是开源的,也许您发现它很有用:

CopyFileVisitor.copy(srcPath, targetPath);  
Run Code Online (Sandbox Code Playgroud)

行家:

<dependency>
    <groupId>org.softsmithy.lib</groupId>
    <artifactId>softsmithy-lib-core</artifactId>
    <version>0.5</version>
</dependency>
Run Code Online (Sandbox Code Playgroud)

教程:http://www.softsmithy.org/softsmithy-lib/lib/0.5/docs/tutorial/nio-file/index.html

Javadoc:http://www.softsmithy.org/softsmithy-lib/lib/0.5/docs/api/softsmithy-lib-core/index.html

源代码: http: //github.com/SoftSmithy/softsmithy-lib