String oldName = D:\careers.bstalents.com\build\web\uploads\Resume\old.doc;
String newName = D:\careers.bstalents.com\build\web\uploads\Resume\new.doc;
File newFile = new File(newName);
File oldFile = new File(oldName);
boolean rename = oldFile.renameTo(newFile);
if (rename) {
outs.write(formFile.getFileData());
outs.close();*/
FileOutputStream fileOutStream = new FileOutputStream(newFile);
fileOutStream.write(resume.getFileData());
fileOutStream.flush();
fileOutStream.close();
}
我发布上面的代码请分享您的观点。这里renameTo()方法无法做到这一点。代码中是否有任何问题?