Java's renaming operation needs to be implemented through the rename function, including
File newFile=new File(file.getParent(),filename);//First generate a new file and file name, file renaming needs to obtain the parent directory file.renameTo(newFile);//Realize file renaming operation