• Post Reply Bookmark Topic Watch Topic
  • New Topic

Files.copy method,Files.move mathod confusion  RSS feed

 
Akshay Rawal
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ranchers..i am learning how to copy and move files in nio2...but stuck in a way...
my directory structure is...java/home/akshay/ak.txt and java/home1/akshay1/ak1.xt ...i want to move or copy ak1.txt in akshay folder...but i am gettng NoSuchFileException..here is my code

PathDemo.java is in java directory

 
Paul Clapham
Sheriff
Posts: 22832
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I notice that you are using a relative path. And it appears that you are assuming your current working directory is "...java". I would suggest you use an absolute path, or else fix the current working directory to be "...java".

Also this doesn't look like a certification exam question to me so I am going to move it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!