将整个目录内容复制到另一个目录? [英] Copy entire directory contents to another directory?

查看:138
本文介绍了将整个目录内容复制到另一个目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将整个目录内容复制到java或groovy中的另一个目录的方法

FileUtils.copyDirectory()


复制整个目录
到保存文件
日期的新位置。此方法将
指定的目录及其所有子
目录和文件复制到指定的
目标中。目的地是
新位置和
目录的名称。



如果目的地目录不存在,则创建目标目录
。如果
目的地目录确实存在,那么
这个方法将源码与
目标合并,源码以
为优先。



Method to copy entire directory contents to another directory in java or groovy?

解决方案

FileUtils.copyDirectory()

Copies a whole directory to a new location preserving the file dates. This method copies the specified directory and all its child directories and files to the specified destination. The destination is the new location and name of the directory.

The destination directory is created if it does not exist. If the destination directory did exist, then this method merges the source with the destination, with the source taking precedence.

这篇关于将整个目录内容复制到另一个目录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆