Files.walk实现优雅拷贝多级目录
/**
* @author ycw
* @version v1.0
* @date 2022/3/17 16:15
* @description
*/
public class TestFilesWalkFileTree {
public static void main(String[] args) throws IOException {
String source = "E://opt";
String target = "E://ept";
Files.walk(Paths.get(source)).forEach(path -> {
try {
String targetName = path.toString().replace(source,target);
共有 0 条评论