I have a file I need to rename to that of an existing file. This is a copy, modify, replace original operation on an existing JAR file. I\'ve got the first two steps done, I
You're going to need to create two java.io.File objects: one for the new file, one for the old file.
java.io.File
Lets call these oldFile and newFile.
oldFile
newFile
oldFile.delete() newFile.renameTo(oldFile);
Edit: mmyers beat me to it.