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
d6e18499
Commit
d6e18499
authored
7 years ago
by
Sandeep S. Shewalkar
Browse files
Options
Downloads
Patches
Plain Diff
DownloadHelper changes
fileavailability check added
parent
a4aad7fe
Branches
Branches containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
downloadhelper/downloadHelper.go
+9
-6
downloadhelper/downloadHelper.go
with
9 additions
and
6 deletions
downloadhelper/downloadHelper.go
+
9
−
6
View file @
d6e18499
...
...
@@ -32,14 +32,17 @@ func DownloadFile(sourcePath, destinationPath, jwtToken string, retryCnt int) (b
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
filehelper
.
FileAvailabilityCheck
(
destinationPath
)
{
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
)
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