Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
trismegisto-services
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
Mauro Paolo Josue Zuñiga Mallqui
trismegisto-services
Commits
62b5d96f
Commit
62b5d96f
authored
Nov 29, 2024
by
Sony Montoya Eslava
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[FIXED] getFile
parent
f6da5199
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
DriveService.java
...ask/trismegistoservices/services/google/DriveService.java
+13
-0
No files found.
src/main/java/web/multitask/trismegistoservices/services/google/DriveService.java
View file @
62b5d96f
...
...
@@ -3,6 +3,7 @@ package web.multitask.trismegistoservices.services.google;
import
java.io.*
;
import
java.nio.file.Files
;
import
java.util.Collections
;
import
java.util.concurrent.CompletableFuture
;
import
lombok.AllArgsConstructor
;
import
org.json.JSONObject
;
...
...
@@ -94,6 +95,18 @@ public class DriveService implements IDriveService {
Resource
resource
=
commonUtils
.
fileToResource
(
tempFile
);
HttpHeaders
headers
=
new
HttpHeaders
();
headers
.
add
(
HttpHeaders
.
CONTENT_DISPOSITION
,
"attachment; filename="
+
file
.
getName
());
CompletableFuture
.
runAsync
(()
->
{
try
{
Thread
.
sleep
(
15000
);
if
(
tempFile
.
exists
())
{
tempFile
.
delete
();
}
}
catch
(
InterruptedException
e
)
{
Thread
.
currentThread
().
interrupt
();
}
});
return
ResponseEntity
.
ok
()
.
headers
(
headers
)
.
contentLength
(
tempFile
.
length
())
...
...
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