Videos
myFile.renameTo(new File("/the/new/place/newName.file"));
File#renameTo does that (it can not only rename, but also move between directories, at least on the same file system).
Renames the file denoted by this abstract pathname.
Many aspects of the behavior of this method are inherently platform-dependent: The rename operation might not be able to move a file from one filesystem to another, it might not be atomic, and it might not succeed if a file with the destination abstract pathname already exists. The return value should always be checked to make sure that the rename operation was successful.
If you need a more comprehensive solution (such as wanting to move the file between disks), look at Apache Commons FileUtils#moveFile
With Java 7 or newer you can use Files.move(from, to, CopyOption... options).
E.g.
Files.move(Paths.get("/foo.txt"), Paths.get("bar.txt"), StandardCopyOption.REPLACE_EXISTING);
See the Files documentation for more details
Hey peeps!
So, I've got a question.
(On W10) I've got this folder, inside this folder there are many, many more folders (Around 50), and inside THESE folders, there are some files inside (Ranging from 1-10). I've got 3 of these folders (3 folders, all containing around 50 folders with some files inside of them ranging from 1-10)
I want to move the files inside of the huge folder (containing 50 folders, inside of the other folders (one of the folders from all the 50 folders inside the huge folder containing these folders), to another folder.
Currently, the only reasonable fast way to do this I know of, is having the huge folder open and the destination folder open, at the same time. Then going inside of one of these 50 folders, CTRL+A, CTRL+C, click to the open destination folder, CTRL+V. Click back to folder containing files, click back to the huge folder, open another folder, repeat. I have to do this 50x3 times, quite tiring.
TL;DR: I'm having to move files inside a folder, inside a huge folder, containing 50 of these folders, to another folder, 50x3 times.
So my question to you lovely peeps is:
How can I do this faster?