Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
TensorFlow Manager
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Bioimage Analysis
TensorFlow Manager
Commits
69afd529
Commit
69afd529
authored
1 year ago
by
Cgarcia
Browse files
Options
Downloads
Patches
Plain Diff
improve the engines download
parent
23268588
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/org/bioimageanalysis/icy/deeplearning/versionmanager/downloading/DeepLearningVersionDownloader.java
+10
-3
10 additions, 3 deletions
...ionmanager/downloading/DeepLearningVersionDownloader.java
with
10 additions
and
3 deletions
src/main/java/org/bioimageanalysis/icy/deeplearning/versionmanager/downloading/DeepLearningVersionDownloader.java
+
10
−
3
View file @
69afd529
...
...
@@ -253,7 +253,6 @@ public class DeepLearningVersionDownloader
private
static
Path
downloadFile
(
String
urlString
,
Path
targetDirectory
,
ProgressListener
progressListener
)
throws
IOException
{
URL
url
=
new
URL
(
urlString
);
Path
localFilePath
=
toLocalVersionFile
(
targetDirectory
,
urlString
);
Files
.
deleteIfExists
(
localFilePath
);
...
...
@@ -261,8 +260,16 @@ public class DeepLearningVersionDownloader
try
{
HttpURLConnection
httpConnection
=
(
HttpURLConnection
)
(
url
.
openConnection
());
long
completeFileSize
=
httpConnection
.
getContentLength
();
while
(
httpConnection
.
getResponseCode
()
==
302
)
{
url
=
new
URL
(
httpConnection
.
getHeaderField
(
"Location"
));
httpConnection
=
(
HttpURLConnection
)
(
url
.
openConnection
());
}
long
completeFileSize
=
httpConnection
.
getContentLengthLong
();
if
(
completeFileSize
==
-
1
)
{
progressListener
.
notifyProgress
(
1
,
1
);
return
downloadFile
(
urlString
,
targetDirectory
);
}
completeFileSize
=
1
;
try
(
BufferedInputStream
in
=
new
BufferedInputStream
(
httpConnection
.
getInputStream
()))
{
FileOutputStream
fos
=
new
FileOutputStream
(
localFilePath
.
toFile
());
...
...
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