记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董敬伟
liquidnet-bus-v1
Commits
dfc5de1d
Commit
dfc5de1d
authored
Aug 24, 2021
by
jiangxiulong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
二次上传未删除临时图片
parent
f493b25d
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
FilesUtils.java
...main/java/com/liquidnet/commons/lang/util/FilesUtils.java
+11
-5
AlOssController.java
...ce/platform/controller/basicServices/AlOssController.java
+3
-1
No files found.
liquidnet-bus-common/liquidnet-common-base/src/main/java/com/liquidnet/commons/lang/util/FilesUtils.java
View file @
dfc5de1d
package
com
.
liquidnet
.
commons
.
lang
.
util
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.*
;
...
...
@@ -11,6 +12,7 @@ import java.security.MessageDigest;
* @author jiangxiulong
* @since 2021-06-10
*/
@Slf4j
public
class
FilesUtils
{
/**
* MultipartFile 转 File
...
...
@@ -45,7 +47,7 @@ public class FilesUtils {
os
.
close
();
ins
.
close
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"inputStreamToFileError"
,
e
);
}
}
...
...
@@ -54,9 +56,13 @@ public class FilesUtils {
* @param file
*/
public
static
void
delteTempFile
(
File
file
)
{
try
{
if
(
file
!=
null
)
{
file
.
delete
();
}
}
catch
(
Exception
e
)
{
log
.
error
(
"delteTempFileError"
,
e
);
}
}
/**
...
...
@@ -81,13 +87,13 @@ public class FilesUtils {
BigInteger
bigInt
=
new
BigInteger
(
1
,
digest
.
digest
());
return
bigInt
.
toString
(
16
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"getFileMD5CatchError"
,
e
);
return
null
;
}
finally
{
try
{
in
.
close
();
}
catch
(
Exception
e
)
{
e
.
printStackTrace
(
);
log
.
error
(
"getFileMD5FinallyError"
,
e
);
}
}
}
...
...
liquidnet-bus-service/liquidnet-service-platform/liquidnet-service-platform-impl/src/main/java/com/liquidnet/service/platform/controller/basicServices/AlOssController.java
View file @
dfc5de1d
...
...
@@ -111,7 +111,6 @@ public class AlOssController {
}
ossClient
.
shutdown
();
FilesUtils
.
delteTempFile
(
fileNew
);
// 删除临时文件
// 入库
PlatformOssFiles
platformOssFilesDate
=
new
PlatformOssFiles
();
...
...
@@ -131,6 +130,9 @@ public class AlOssController {
PlatformOssFiles
platformOssFilesOne
=
platformOssFiles
.
get
(
0
);
BeanUtils
.
copyProperties
(
platformOssFilesOne
,
uploadVo
);
}
FilesUtils
.
delteTempFile
(
fileNew
);
// 删除临时文件
return
ResponseDto
.
success
(
uploadVo
);
}
...
...
Write
Preview
Markdown
is supported
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