File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • 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
  • 0
  • 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
  • 0
  • 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)

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic