Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

use walkFileTree to copy all the directory and files in the sub-directory

 
leometal Chen
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the example in <java se 7 programmer exam...> for Revisiting File Copy,when I execute it and found the source directory and the files inside are copied into directories no any files inside.
For example, there is a Test.java file in the source directory and it will be copied as a named Test.java directory.

I would like to know what is the problem in side,thanks a lot!

code as follow:

 
leometal Chen
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you,I already found the problem that Files.copy(source parameter should be path)

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic