Reputation: 19
I have a folder called "data". It's in a subdirectory of my system, lets say in "big folder." I want to move the data folder out to my home folder, or "user." So the data folder's path is user/big folder/data. How do I move it out?
Upvotes: 0
Views: 124
Reputation: 32306
You should play around with the following snippet (not tested):
File src = new File("user/big folder/data");
File dest = new File("user");
boolean success = src.renameTo(new File(dest, src.getName()));
if (!success) {
// Directory was not successfully moved
}
Upvotes: 1