Thanks MIchel, I missed this part.
Even though I used these properties, I am still getting HTTP 401. I am trying pull some images from our corporate share point website.
When I try in browser, unlike other website this website through s a pop up window for username and password. Is there any thing which I need to do specific about it.
Here is the sample code snippet I am using to download.
task downloadFile(type: Download) {
src ‘xxxxxxxxxx/photo.png’
dest buildDir
username ‘username’
password 'Password
}