How do I move a file from one location to another in Java?
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 … Read more