Bug in Files.copy() where the source Path is a directory... It _is_ a bug, right?

Alan Bateman Alan.Bateman at oracle.com
Wed Dec 10 21:34:04 UTC 2014


On 10/12/2014 19:48, Francis Galiegue wrote:
> :
>
> Yep, it only copied the directory entry and no files under it!
>
Here's what the javadoc says:

"If the file is a directory then it creates an empty directory in the 
target location (entries in the directory are not copied). This method 
can be used with the walkFileTree method to copy a directory and all 
entries in the directory, or an entire file-tree where required."

There have been requests over the years to add support for recursive 
copy, maybe a copyFileTree method but all suggestions to date didn't get 
to a consensus on how exceptions should be handled when only a subset of 
the file tree can be copied. Maybe some day.

-Alan




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20141210/f7332ed3/attachment.html>


More information about the nio-dev mailing list