Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
MKCLOS
Core Development Platform
coreospackage
Commits
a4aad7fe
Commit
a4aad7fe
authored
7 years ago
by
Ajit Jagtap
Browse files
Options
Downloads
Plain Diff
Merge branch 'dwnloadhelper_SSS' into 'master'
download helper See merge request
!34
parents
eb2eb387
8fb93dd4
Branches
Branches containing commit
1 merge request
!34
download helper
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
downloadhelper/downloadHelper.go
+9
-0
downloadhelper/downloadHelper.go
with
9 additions
and
0 deletions
downloadhelper/downloadHelper.go
+
9
−
0
View file @
a4aad7fe
...
...
@@ -31,6 +31,15 @@ func DownloadFile(sourcePath, destinationPath, jwtToken string, retryCnt int) (b
if
strings
.
Trim
(
sourcePath
,
EMPTY_STR
)
==
EMPTY_STR
||
strings
.
Trim
(
destinationPath
,
EMPTY_STR
)
==
EMPTY_STR
||
!
strings
.
HasPrefix
(
sourcePath
,
HTTP_PROTOCOL
)
{
return
false
,
errors
.
New
(
"Either Source/Destination url is empty or source url does not start with 'http'"
)
}
// dest directory must be a string. check for the same.
destInfo
,
infoError
:=
filehelper
.
FileInfo
(
destinationPath
)
if
infoError
!=
nil
{
return
false
,
errors
.
New
(
"error occured while getting innformation of destination directory : "
+
destinationPath
)
}
if
destInfo
.
IsDir
()
{
return
false
,
errors
.
New
(
"destination path must be a file path, got directory : "
+
destinationPath
)
}
client
:=
grab
.
NewClient
()
req
,
_
:=
grab
.
NewRequest
(
destinationPath
,
sourcePath
)
if
jwtToken
!=
"NA"
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets