Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Submit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EIP
Labrador
Submit
Merge requests
!44
Download work around
Code
Review changes
Check out branch
Open in Workspace
Download
Patches
Plain diff
Expand sidebar
Merged
Download work around
development
into
master
Overview
0
Commits
4
Pipelines
0
Changes
2
Merged
Download work around
Otto Visser
requested to merge
development
into
master
Sep 5, 2020
Overview
0
Commits
4
Pipelines
0
Changes
2
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
1ca2c8f7
4 commits,
Sep 5, 2020
2 files
+
9
−
7
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
src/main/java/nl/tudelft/submit/service/FileService.java
+
5
−
5
View file @ 1ca2c8f7
Edit in single-file editor
Open in Web IDE
Show full file
@@ -122,16 +122,16 @@ public class FileService {
* @throws Exception if the file cannot be found (this should not happen)
*/
public
Resource
downloadFiles
(
Long
entityId
,
String
directory
)
throws
IOException
{
String
zipName
=
directory
+
"_"
+
entityId
+
".zip"
;
String
zipName
=
"_"
+
entityId
+
".zip"
;
Path
path
=
Paths
.
get
(
"./"
+
directory
+
File
.
separator
+
StringUtils
.
cleanPath
(
getDirectory
(
entityId
)));
.
get
(
directory
+
File
.
separator
+
StringUtils
.
cleanPath
(
getDirectory
(
entityId
)));
File
dir
=
new
File
(
String
.
valueOf
(
path
));
File
zipDir
=
new
File
(
"
.
/zips
"
);
File
zipDir
=
new
File
(
"
/tmp
/zips
/"
+
directory
);
zipDir
.
mkdirs
();
FileOutputStream
stream
=
new
FileOutputStream
(
"
.
/zips/"
+
zipName
);
FileOutputStream
stream
=
new
FileOutputStream
(
"
/tmp
/zips/"
+
directory
+
File
.
separator
+
zipName
);
ZipOutputStream
zipFile
=
new
ZipOutputStream
(
stream
);
for
(
File
f
:
dir
.
listFiles
())
{
FileInputStream
fis
=
new
FileInputStream
(
f
);
@@ -148,7 +148,7 @@ public class FileService {
zipFile
.
close
();
stream
.
close
();
return
new
UrlResource
(
"file:
.
/zips/"
+
zipName
);
return
new
UrlResource
(
"file:
///tmp
/zips/"
+
zipName
);
}
Loading