File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes use walkFileTree to copy all the directory and files in the sub-directory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "use walkFileTree to copy all the directory and files in the sub-directory" Watch "use walkFileTree to copy all the directory and files in the sub-directory" New topic
Author

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

leometal Chen
Greenhorn

Joined: Dec 02, 2013
Posts: 8
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

Joined: Dec 02, 2013
Posts: 8
thank you,I already found the problem that Files.copy(source parameter should be path)

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: use walkFileTree to copy all the directory and files in the sub-directory