Rename file onto another in java

后端 未结 5 1986
迷失自我
迷失自我 2021-01-15 03:26

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

5条回答
  •  时光取名叫无心
    2021-01-15 03:56

    Java.io.File.renameTo(java.io.File)

    You might need to call File.delete() first on the original file first - some systems won't rename a file onto an existing file.

提交回复
热议问题