Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

renameTo won't move file

807589Feb 15 2007 — edited Aug 7 2008
Hello,

I am trying to move a file. in the root dir it works, but when im working in sub dir it renameTo returns me false. i tried everything including checking the security and it has no problems. here is the code:

File newDir = new File(dir,artist);
File dest = new File(newDir,file.getName());
System.out.println(file.renameTo(dest));

thank you!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 4 2008
Added on Feb 15 2007
14 comments
1,020 views