How do I move a file from one location to another in Java?
How do you move a file from one location to another? When I run my program any file created in that location automatically moves to the specified location. How do I know which file is moved? Thanks in advance! Thilo 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