Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
RuoYi Vue
Commits
14ea0713
Commit
14ea0713
authored
May 08, 2021
by
libin
Browse files
修复文件上传时java.nio.file.FileAlreadyExistsException
parent
50034301
Changes
1
Hide whitespace changes
Inline
Side-by-side
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
View file @
14ea0713
...
...
@@ -130,14 +130,10 @@ public class FileUploadUtils
private
static
final
File
getAbsoluteFile
(
String
uploadDir
,
String
fileName
)
throws
IOException
{
File
desc
=
new
File
(
uploadDir
+
File
.
separator
+
fileName
);
if
(!
desc
.
getParentFile
().
exists
())
{
desc
.
getParentFile
().
mkdirs
();
}
if
(!
desc
.
exists
())
{
desc
.
createNewFile
();
if
(!
desc
.
exists
())
{
if
(!
desc
.
getParentFile
().
exists
())
{
desc
.
getParentFile
().
mkdirs
();
}
}
return
desc
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment