"git@ustchcs.com:gujinli1118/MCMS.git" did not exist on "55b338db4e865bf259de2b6fb2bae55c36854633"
Commit bdde195e authored by 若依's avatar 若依
Browse files

!225 【bug修复】文件上传时出现java.nio.file.FileAlreadyExistsException

Merge pull request !225 from CANYON/master
parents 50034301 14ea0713
...@@ -130,14 +130,10 @@ public class FileUploadUtils ...@@ -130,14 +130,10 @@ public class FileUploadUtils
private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException private static final File getAbsoluteFile(String uploadDir, String fileName) throws IOException
{ {
File desc = new File(uploadDir + File.separator + fileName); File desc = new File(uploadDir + File.separator + fileName);
if (!desc.exists()) {
if (!desc.getParentFile().exists()) if (!desc.getParentFile().exists()) {
{ desc.getParentFile().mkdirs();
desc.getParentFile().mkdirs(); }
}
if (!desc.exists())
{
desc.createNewFile();
} }
return desc; return desc;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment