可能重复:
Copying files from one directory to another in Java
Copy entire directory contents to another directory?如何在java中复制目录?
我怎样才能在Java中复制一个目录?
例子我想dir将一个被复制
from src\A to dest
最后的文件夹结构应该是
dest\A.
可能重复:
Copying files from one directory to another in Java
Copy entire directory contents to another directory?如何在java中复制目录?
我怎样才能在Java中复制一个目录?
例子我想dir将一个被复制
from src\A to dest
最后的文件夹结构应该是
dest\A.
你可以使用Apache Commons IO (v2.1)。它包括为您提供该方法的FileUtils
。
FileUtils.copyDirectory(SRC,目标寄存器)
Files.copy(source + "/" + folderName, target + "/" + folderName, REPLACE_EXISTING);