Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-jams
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-jams
Commits
7212d2e7
Commit
7212d2e7
authored
4 years ago
by
Larbi Gharib
Browse files
Options
Downloads
Patches
Plain Diff
Fix tmp folder exists
Change-Id: Ib4b9a1c0459346e8a965c022c203796cd258e642
parent
07be6cf0
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
jams-server/src/main/java/net/jami/jams/server/update/UpdateDownloader.java
+17
-4
17 additions, 4 deletions
...in/java/net/jami/jams/server/update/UpdateDownloader.java
with
17 additions
and
4 deletions
jams-server/src/main/java/net/jami/jams/server/update/UpdateDownloader.java
+
17
−
4
View file @
7212d2e7
...
...
@@ -103,14 +103,27 @@ public class UpdateDownloader {
// temp folder for safe download and integrity check
File
tmpFolder
=
new
File
(
System
.
getProperty
(
"user.dir"
)
+
"/tmp/"
);
if
(!
tmpFolder
.
mkdirs
()){
log
.
error
(
"Could not create temporary folder to store the update files!"
);
return
false
;
}
if
(!
tmpFolder
.
exists
()){
try
{
tmpFolder
.
mkdirs
();
}
catch
(
Exception
e
)
{
log
.
error
(
"Error creating folder:"
+
e
);
return
false
;
}
}
files
.
forEach
((
k
,
v
)
->
{
try
{
File
tmpFile
=
new
File
(
System
.
getProperty
(
"user.dir"
)
+
"/tmp/"
+
v
.
getFileName
());
if
(
tmpFile
.
exists
()){
try
{
tmpFile
.
delete
();
}
catch
(
Exception
e
)
{
log
.
warn
(
"Error deleting file: "
+
v
.
getFileName
()
+
" with error "
+
e
);
}
}
HttpClient
httpClient
=
HttpClients
.
custom
().
setSSLContext
(
sslContext
).
build
();
HttpResponse
httpResponse
=
httpClient
.
execute
(
new
HttpGet
(
UPDATE_SERVER_URL
+
"/updates/"
+
v
.
getFileName
()));
if
(
httpResponse
.
getStatusLine
().
getStatusCode
()
!=
200
)
return
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment