Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-cloud
Overview
Overview
Details
Activity
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
data-hook
gic-cloud
Commits
08bb27ae
Commit
08bb27ae
authored
Apr 07, 2023
by
fudahua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新版本的下载
parent
d827216c
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
FlatQueryResultServiceImpl.java
...ud/data/hook/service/impl/FlatQueryResultServiceImpl.java
+32
-0
No files found.
gic-cloud-data-hook-service/src/main/java/com/gic/cloud/data/hook/service/impl/FlatQueryResultServiceImpl.java
View file @
08bb27ae
...
...
@@ -912,6 +912,9 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
}
catch
(
Exception
e
)
{
logger
.
info
(
"异常:{}"
,
e
);
}
finally
{
//删除文件
delFileOrDirByTaskId
(
task
.
getId
());
}
}
...
...
@@ -921,6 +924,35 @@ public class FlatQueryResultServiceImpl implements IFlatQueryResultService {
}
private
void
delFileOrDirByTaskId
(
String
taskId
){
File
file
=
new
File
(
SAVE_FOLDER
);
File
[]
files
=
file
.
listFiles
();
for
(
File
midFile
:
files
)
{
if
(
midFile
.
getName
().
equals
(
taskId
))
{
if
(
midFile
.
isDirectory
())
{
delDir
(
midFile
);
}
else
{
midFile
.
delete
();
}
}
}
}
private
void
delDir
(
File
dirFile
)
{
if
(
dirFile
.
getPath
().
startsWith
(
SAVE_FOLDER
))
{
File
[]
files
=
dirFile
.
listFiles
();
for
(
File
file
:
files
)
{
if
(
file
.
isDirectory
())
{
delDir
(
file
);
}
else
{
file
.
delete
();
}
}
dirFile
.
delete
();
}
}
/**
* 读物文件
* @param dirName
...
...
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