openFile = new File(file.getPath()+"\\"+names);String newFileName = this.reName(openFile.getName());
String newFilePath = openFile.getParent()+"\\"+newFileName;
openFile.renameTo(new File(newFilePath));
原文件(目录)openFile ,重命名为newFileName ,执行renameTo后文件名不变,为什么??
String newFilePath = openFile.getParent()+"\\"+newFileName;
openFile.renameTo(new File(newFilePath));
原文件(目录)openFile ,重命名为newFileName ,执行renameTo后文件名不变,为什么??
2、newFilePath路径不合法
3、openFile指向文件不存。
这个reName是怎么实现的,一般是传2个参数进去吧,新名字和旧名字,你把旧名字传进去感觉没变啊