[SPARK-9254] [BUILD] [HOTFIX] sbt-launch-lib.bash should support HTTP/HTTPS redirection
[SPARK-9254] [BUILD] [HOTFIX] sbt-launch-lib.bash should support HTTP/HTTPS redirection

Target file(s) can be hosted on CDN nodes. HTTP/HTTPS redirection must be supported to download these files.

Author: Cheng Lian <lian@databricks.com>

Closes #7597 from liancheng/spark-9254 and squashes the following commits:

fd266ca [Cheng Lian] Uses `--fail' to make curl return non-zero value and remove garbage output when the download fails
a7cbfb3 [Cheng Lian] Supports HTTP/HTTPS redirection

sachintyagi22/spark,rekhajoshm/spark,gengliangwang/spark,shuangshuangwang/spark,holdenk/spark,mahak/spark,SnappyDataInc/spark,bOOm-X/spark,chuckchen/spark,cloud-fan/spark,SnappyDataInc/spark,nilsgrabbert/spark,sahilTakiar/spark,cin/spark,Panos-Bletsos/spark-cost-model-optimizer,stanzhai/spark,WindCanDie/spark,ConeyLiu/spark,apache-spark-on-k8s/spark,rikima/spark,akopich/spark,BryanCutler/spark,spark-test/spark,huang1900/spark,nlalevee/spark,Panos-Bletsos/spark-cost-model-optimizer,szhem/spark,ajaysaini725/spark,kiszk/spark,liutang123/spark,shaneknapp/spark,ericvandenbergfb/spark,ConeyLiu/spark,setjet/spark,SnappyDataInc/spark,jianran/spark,lxsmnv/spark,sachintyagi22/spark,sureshthalamati/spark,wangmiao1981/spark,szhem/spark,ConeyLiu/spark,jianran/spark,icexelloss/spark,someorz/spark,apache/spark,akopich/spark,ericvandenbergfb/spark,yanboliang/spark,zzcclp/spark,witgo/spark,maropu/spark,gioenn/xSpark,rezasafi/spark,alunarbeach/spark,markhamstra/spark,loneknightpy/spark,tejasapatil/spark,joseph-torres/spark,WindCanDie/spark,wangyum/spark,wangyum/spark,lvdongr/spark,ron8hu/spark,nilsgrabbert/spark,shubhamchopra/spark,poffuomo/spark,gengliangwang/spark,mike0sv/spark,metamx/spark,jlopezmalla/spark,apache-spark-on-k8s/spark,rekhajoshm/spark,Aegeaner/spark,guoxiaolongzte/spark,JoshRosen/spark,vinodkc/spark,nchammas/spark,byakuinss/spark,map222/spark,stanzhai/spark,mahak/spark,srowen/spark,nchammas/spark,actuaryzhang/spark,narahari92/spark,mzl9039/spark,ericvandenbergfb/spark,lvdongr/spark,milliman/spark,aokolnychyi/spark,witgo/spark,vinodkc/spark,1haodian/spark,ibm-research-ireland/sparkoscope,bravo-zhang/spark,UndeadBaneGitHub/spark,mahak/spark,icexelloss/spark,xuanyuanking/spark,aosagie/spark,techaddict/spark,cloud-fan/spark,gengliangwang/spark,jkbradley/spark,yanboliang/spark,big-pegasus/spark,cloud-fan/spark,alunarbeach/spark,sureshthalamati/spark,setjet/spark,spark-test/spark,skonto/spark,cin/spark,tejasapatil/spark,shuangshuangwang/spark,gioenn/xSpark,patrick-nicholson/spark,ibm-research-ireland/sparkoscope,vinodkc/spark,LantaoJin/spark,tengpeng/spark,pronix/spark,facaiy/spark,esi-mineset/spark,1haodian/spark,joseph-torres/spark,wangmiao1981/spark,BryanCutler/spark,adrian-ionescu/apache-spark,yanboliang/spark,WeichenXu123/spark,kiszk/spark,ajaysaini725/spark,SHASHANKB/spark,SHASHANKB/spark,aray/spark,zuotingbing/spark,ptkool/spark,map222/spark,publicRoman/spark,Aegeaner/spark,holdenk/spark,gioenn/xSpark,loneknightpy/spark,bdrillard/spark,ddna1021/spark,janewangfb/spark,BryanCutler/spark,mdespriee/spark,rikima/spark,publicRoman/spark,wzhfy/spark,techaddict/spark,bOOm-X/spark,kevinyu98/spark,zhouyejoe/spark,actuaryzhang/spark,huang1900/spark,zzcclp/spark,shuangshuangwang/spark,saturday-shi/spark,shaneknapp/spark,HyukjinKwon/spark,techaddict/spark,esi-mineset/spark,srowen/spark,zuotingbing/spark,saltstar/spark,hvanhovell/spark,tengpeng/spark,HyukjinKwon/spark,nilsgrabbert/spark,WindCanDie/spark,rikima/spark,WeichenXu123/spark,hhbyyh/spark,hhbyyh/spark,JoshRosen/spark,liutang123/spark,UndeadBaneGitHub/spark,hvanhovell/spark,big-pegasus/spark,ddna1021/spark,SnappyDataInc/spark,mike0sv/spark,jlopezmalla/spark,xuanyuanking/spark,nilsgrabbert/spark,SnappyDataInc/spark,michalsenkyr/spark,ron8hu/spark,skonto/spark,huang1900/spark,lxsmnv/spark,aray/spark,kimoonkim/spark,JerryLead/spark,shuangshuangwang/spark,andrewor14/spark,kissmetrics/spark,yanboliang/spark,mzl9039/spark,wangyum/spark,caneGuy/spark,jrshust/spark,pgandhi999/spark,jianran/spark,dhruve/spark,actuaryzhang/spark,big-pegasus/spark,saturday-shi/spark,dongjoon-hyun/spark,zzcclp/spark,joseph-torres/spark,bravo-zhang/spark,publicRoman/spark,stanzhai/spark,bravo-zhang/spark,skonto/spark,ron8hu/spark,vinodkc/spark,someorz/spark,adrian-ionescu/apache-spark,kimoonkim/spark,highfei2011/spark,esi-mineset/spark,haowu80s/spark,alunarbeach/spark,HyukjinKwon/spark,bravo-zhang/spark,ahnqirage/spark,esi-mineset/spark,tejasapatil/spark,ericvandenbergfb/spark,hvanhovell/spark,tengpeng/spark,gengliangwang/spark,markhamstra/spark,poffuomo/spark,patrick-nicholson/spark,guoxiaolongzte/spark,bdrillard/spark,rednaxelafx/apache-spark,UndeadBaneGitHub/spark,wzhfy/spark,mike0sv/spark,actuaryzhang/spark,panfengfeng/spark,JerryLead/spark,ioana-delaney/spark,milliman/spark,bdrillard/spark,kimoonkim/spark,hhbyyh/spark,skonto/spark,shuangshuangwang/spark,nilsgrabbert/spark,rednaxelafx/apache-spark,lvdongr/spark,lxsmnv/spark,metamx/spark,goldmedal/spark,zzcclp/spark,someorz/spark,tejasapatil/spark,someorz/spark,1haodian/spark,cloud-fan/spark,sahilTakiar/spark,joseph-torres/spark,lxsmnv/spark,nlalevee/spark,jkbradley/spark,debugger87/spark,actuaryzhang/spark,michalsenkyr/spark,tejasapatil/spark,UndeadBaneGitHub/spark,lxsmnv/spark,zero323/spark,dbtsai/spark,dhruve/spark,andrewor14/spark,gengliangwang/spark,xflin/spark,szhem/spark,janewangfb/spark,shaneknapp/spark,maropu/spark,apache/spark,ahnqirage/spark,jlopezmalla/spark,panfengfeng/spark,shubhamchopra/spark,ahnqirage/spark,kevinyu98/spark,narahari92/spark,pronix/spark,wangyum/spark,pronix/spark,saltstar/spark,janewangfb/spark,aosagie/spark,cin/spark,witgo/spark,cin/spark,kimoonkim/spark,dbtsai/spark,liyichao/spark,ConeyLiu/spark,cloud-fan/spark,big-pegasus/spark,mdespriee/spark,rekhajoshm/spark,rednaxelafx/apache-spark,eyalfa/spark,UndeadBaneGitHub/spark,spark-test/spark,apache/spark,setjet/spark,sachintyagi22/spark,map222/spark,dongjoon-hyun/spark,nlalevee/spark,sureshthalamati/spark,setjet/spark,yanboliang/spark,eyalfa/spark,icexelloss/spark,saturday-shi/spark,skonto/spark,JerryLead/spark,rikima/spark,debugger87/spark,facaiy/spark,wangmiao1981/spark,joseph-torres/spark,setjet/spark,apache-spark-on-k8s/spark,saturday-shi/spark,dbtsai/spark,jrshust/spark,shubhamchopra/spark,shuangshuangwang/spark,kissmetrics/spark,akopich/spark,goldmedal/spark,someorz/spark,ajaysaini725/spark,dbtsai/spark,liyichao/spark,nchammas/spark,esi-mineset/spark,chuckchen/spark,janewangfb/spark,jiangxb1987/spark,MLnick/spark,liyichao/spark,Aegeaner/spark,michalsenkyr/spark,mike0sv/spark,map222/spark,tengpeng/spark,dhruve/spark,chuckchen/spark,taroplus/spark,actuaryzhang/spark,HyukjinKwon/spark,lvdongr/spark,matthewfranglen/spark,kissmetrics/spark,Panos-Bletsos/spark-cost-model-optimizer,mzl9039/spark,spark-test/spark,jkbradley/spark,sachintyagi22/spark,cin/spark,sahilTakiar/spark,narahari92/spark,big-pegasus/spark,zzcclp/spark,darionyaphet/spark,zuotingbing/spark,darionyaphet/spark,zuotingbing/spark,actuaryzhang/spark,spark-test/spark,SHASHANKB/spark,MLnick/spark,liyichao/spark,SHASHANKB/spark,kevinyu98/spark,dongjoon-hyun/spark,rikima/spark,mdespriee/spark,gioenn/xSpark,kiszk/spark,ahnqirage/spark,1haodian/spark,bOOm-X/spark,vinodkc/spark,adrian-ionescu/apache-spark,taroplus/spark,bravo-zhang/spark,stanzhai/spark,aosagie/spark,holdenk/spark,narahari92/spark,shaneknapp/spark,ueshin/apache-spark,kiszk/spark,bdrillard/spark,apache/spark,ahnqirage/spark,goldmedal/spark,rednaxelafx/apache-spark,minixalpha/spark,holdenk/spark,wangyum/spark,wangmiao1981/spark,guoxiaolongzte/spark,loneknightpy/spark,adrian-ionescu/apache-spark,zhouyejoe/spark,minixalpha/spark,MLnick/spark,guoxiaolongzte/spark,rekhajoshm/spark,wangmiao1981/spark,zero323/spark,caneGuy/spark,hvanhovell/spark,WindCanDie/spark,rezasafi/spark,nlalevee/spark,guoxiaolongzte/spark,panfengfeng/spark,ddna1021/spark,SnappyDataInc/spark,publicRoman/spark,markhamstra/spark,wzhfy/spark,brad-kaiser/spark,eyalfa/spark,BryanCutler/spark,dbtsai/spark,JerryLead/spark,liutang123/spark,jianran/spark,jrshust/spark,Aegeaner/spark,saltstar/spark,xuanyuanking/spark,loneknightpy/spark,haowu80s/spark,nchammas/spark,darionyaphet/spark,zhouyejoe/spark,jkbradley/spark,JerryLead/spark,panfengfeng/spark,zuotingbing/spark,sureshthalamati/spark,darionyaphet/spark,UndeadBaneGitHub/spark,dhruve/spark,mike0sv/spark,huang1900/spark,kimoonkim/spark,rednaxelafx/apache-spark,rekhajoshm/spark,WindCanDie/spark,aokolnychyi/spark,xflin/spark,caneGuy/spark,maropu/spark,nchammas/spark,goldmedal/spark,ajaysaini725/spark,srowen/spark,michalsenkyr/spark,akopich/spark,lvdongr/spark,ueshin/apache-spark,shaneknapp/spark,Panos-Bletsos/spark-cost-model-optimizer,darionyaphet/spark,mahak/spark,shubhamchopra/spark,ioana-delaney/spark,darionyaphet/spark,jiangxb1987/spark,LantaoJin/spark,xuanyuanking/spark,joseph-torres/spark,ptkool/spark,aosagie/spark,facaiy/spark,huang1900/spark,narahari92/spark,patrick-nicholson/spark,haowu80s/spark,jiangxb1987/spark,mdespriee/spark,JerryLead/spark,bravo-zhang/spark,tejasapatil/spark,byakuinss/spark,WindCanDie/spark,JoshRosen/spark,rezasafi/spark,skonto/spark,mike0sv/spark,milliman/spark,gengliangwang/spark,Aegeaner/spark,darionyaphet/spark,michalsenkyr/spark,ron8hu/spark,haowu80s/spark,debugger87/spark,big-pegasus/spark,nlalevee/spark,zhouyejoe/spark,brad-kaiser/spark,andrewor14/spark,kissmetrics/spark,sureshthalamati/spark,spark-test/spark,saturday-shi/spark,akopich/spark,ericvandenbergfb/spark,ptkool/spark,jlopezmalla/spark,mzl9039/spark,icexelloss/spark,ajaysaini725/spark,ddna1021/spark,panfengfeng/spark,patrick-nicholson/spark,JoshRosen/spark,rednaxelafx/apache-spark,kimoonkim/spark,alunarbeach/spark,WeichenXu123/spark,maropu/spark,lxsmnv/spark,markhamstra/spark,taroplus/spark,techaddict/spark,apache-spark-on-k8s/spark,caneGuy/spark,apache-spark-on-k8s/spark,ueshin/apache-spark,minixalpha/spark,minixalpha/spark,JoshRosen/spark,metamx/spark,alunarbeach/spark,poffuomo/spark,szhem/spark,nchammas/spark,brad-kaiser/spark,liutang123/spark,WindCanDie/spark,liyichao/spark,gioenn/xSpark,srowen/spark,MLnick/spark,jrshust/spark,Aegeaner/spark,kiszk/spark,mike0sv/spark,aokolnychyi/spark,jiangxb1987/spark,brad-kaiser/spark,dongjoon-hyun/spark,zzcclp/spark,kiszk/spark,markhamstra/spark,sahilTakiar/spark,icexelloss/spark,wangyum/spark,mdespriee/spark,setjet/spark,ddna1021/spark,adrian-ionescu/apache-spark,apache-spark-on-k8s/spark,sahilTakiar/spark,highfei2011/spark,LantaoJin/spark,alunarbeach/spark,ioana-delaney/spark,tejasapatil/spark,mzl9039/spark,maropu/spark,liutang123/spark,andrewor14/spark,sahilTakiar/spark,eyalfa/spark,xuanyuanking/spark,janewangfb/spark,loneknightpy/spark,WeichenXu123/spark,JerryLead/spark,caneGuy/spark,ajaysaini725/spark,ptkool/spark,andrewor14/spark,metamx/spark,HyukjinKwon/spark,ueshin/apache-spark,1haodian/spark,map222/spark,wzhfy/spark,liyichao/spark,tengpeng/spark,holdenk/spark,ioana-delaney/spark,rekhajoshm/spark,jlopezmalla/spark,cloud-fan/spark,byakuinss/spark,BryanCutler/spark,sachintyagi22/spark,chuckchen/spark,dhruve/spark,joseph-torres/spark,panfengfeng/spark,publicRoman/spark,wangmiao1981/spark,zero323/spark,lvdongr/spark,pgandhi999/spark,pronix/spark,maropu/spark,WeichenXu123/spark,sachintyagi22/spark,zuotingbing/spark,mdespriee/spark,nchammas/spark,apache/spark,dhruve/spark,highfei2011/spark,LantaoJin/spark,markhamstra/spark,shubhamchopra/spark,jiangxb1987/spark,szhem/spark,aosagie/spark,brad-kaiser/spark,ron8hu/spark,techaddict/spark,facaiy/spark,someorz/spark,dongjoon-hyun/spark,liyichao/spark,kevinyu98/spark,guoxiaolongzte/spark,pgandhi999/spark,taroplus/spark,MLnick/spark,ptkool/spark,ueshin/apache-spark,milliman/spark,spark-test/spark,zhouyejoe/spark,zhouyejoe/spark,highfei2011/spark,metamx/spark,srowen/spark,ahnqirage/spark,zero323/spark,rekhajoshm/spark,cin/spark,wzhfy/spark,bOOm-X/spark,sachintyagi22/spark,aray/spark,rednaxelafx/apache-spark,pgandhi999/spark,akopich/spark,ioana-delaney/spark,hhbyyh/spark,hhbyyh/spark,nilsgrabbert/spark,mzl9039/spark,ddna1021/spark,ptkool/spark,caneGuy/spark,facaiy/spark,techaddict/spark,facaiy/spark,map222/spark,kimoonkim/spark,huang1900/spark,rezasafi/spark,janewangfb/spark,apache/spark,jkbradley/spark,byakuinss/spark,ibm-research-ireland/sparkoscope,aosagie/spark,goldmedal/spark,aokolnychyi/spark,zero323/spark,ConeyLiu/spark,debugger87/spark,apache/spark,saltstar/spark,apache-spark-on-k8s/spark,jianran/spark,bOOm-X/spark,eyalfa/spark,yanboliang/spark,rikima/spark,xflin/spark,ron8hu/spark,srowen/spark,dongjoon-hyun/spark,ConeyLiu/spark,skonto/spark,panfengfeng/spark,dbtsai/spark,mahak/spark,holdenk/spark,someorz/spark,kiszk/spark,SHASHANKB/spark,adrian-ionescu/apache-spark,goldmedal/spark,zhouyejoe/spark,jkbradley/spark,metamx/spark,hhbyyh/spark,ibm-research-ireland/sparkoscope,sureshthalamati/spark,byakuinss/spark,debugger87/spark,stanzhai/spark,highfei2011/spark,kevinyu98/spark,ericvandenbergfb/spark,loneknightpy/spark,byakuinss/spark,liutang123/spark,facaiy/spark,eyalfa/spark,dhruve/spark,ahnqirage/spark,minixalpha/spark,saturday-shi/spark,aray/spark,ioana-delaney/spark,zero323/spark,jrshust/spark,Panos-Bletsos/spark-cost-model-optimizer,saturday-shi/spark,markhamstra/spark,caneGuy/spark,shaneknapp/spark,SHASHANKB/spark,JoshRosen/spark,bOOm-X/spark,Aegeaner/spark,vinodkc/spark,aokolnychyi/spark,SHASHANKB/spark,holdenk/spark,Panos-Bletsos/spark-cost-model-optimizer,aosagie/spark,hhbyyh/spark,bdrillard/spark,map222/spark,1haodian/spark,wzhfy/spark,publicRoman/spark,LantaoJin/spark,mahak/spark,poffuomo/spark,LantaoJin/spark,adrian-ionescu/apache-spark,WeichenXu123/spark,patrick-nicholson/spark,witgo/spark,debugger87/spark,Panos-Bletsos/spark-cost-model-optimizer,taroplus/spark,saltstar/spark,milliman/spark,szhem/spark,BryanCutler/spark,michalsenkyr/spark,esi-mineset/spark,big-pegasus/spark,MLnick/spark,andrewor14/spark,alunarbeach/spark,jianran/spark,tengpeng/spark,bdrillard/spark,publicRoman/spark,WeichenXu123/spark,nlalevee/spark,ptkool/spark,techaddict/spark,stanzhai/spark,ericvandenbergfb/spark,rezasafi/spark,saltstar/spark,debugger87/spark,xuanyuanking/spark,bdrillard/spark,pgandhi999/spark,dongjoon-hyun/spark,hvanhovell/spark,1haodian/spark,nilsgrabbert/spark,witgo/spark,highfei2011/spark,mahak/spark,ibm-research-ireland/sparkoscope,byakuinss/spark,UndeadBaneGitHub/spark,sureshthalamati/spark,cloud-fan/spark,lvdongr/spark,xuanyuanking/spark,janewangfb/spark,wangmiao1981/spark,esi-mineset/spark,shuangshuangwang/spark,aray/spark,xflin/spark,shubhamchopra/spark,jiangxb1987/spark,jianran/spark,vinodkc/spark,witgo/spark,jrshust/spark,jrshust/spark,aray/spark,milliman/spark,hvanhovell/spark,tengpeng/spark,goldmedal/spark,ibm-research-ireland/sparkoscope,gioenn/xSpark,chuckchen/spark,milliman/spark,poffuomo/spark,gioenn/xSpark,JoshRosen/spark,mzl9039/spark,patrick-nicholson/spark,cin/spark,ueshin/apache-spark,bravo-zhang/spark,narahari92/spark,huang1900/spark,aray/spark,kevinyu98/spark,poffuomo/spark,taroplus/spark,ibm-research-ireland/sparkoscope,pronix/spark,pgandhi999/spark,zuotingbing/spark,ioana-delaney/spark,setjet/spark,pgandhi999/spark,ajaysaini725/spark,zzcclp/spark,shaneknapp/spark,andrewor14/spark,jkbradley/spark,HyukjinKwon/spark,kissmetrics/spark,kevinyu98/spark,xflin/spark,wangyum/spark,jiangxb1987/spark,narahari92/spark,michalsenkyr/spark,taroplus/spark,highfei2011/spark,maropu/spark,bOOm-X/spark,haowu80s/spark,liutang123/spark,brad-kaiser/spark,kissmetrics/spark,LantaoJin/spark,xflin/spark,wzhfy/spark,brad-kaiser/spark,gengliangwang/spark,nlalevee/spark,MLnick/spark,xflin/spark,eyalfa/spark,aokolnychyi/spark,akopich/spark,yanboliang/spark,ddna1021/spark,srowen/spark,ron8hu/spark,shubhamchopra/spark,icexelloss/spark,szhem/spark,chuckchen/spark,haowu80s/spark,guoxiaolongzte/spark,poffuomo/spark,chuckchen/spark,rikima/spark,ConeyLiu/spark,jlopezmalla/spark,jlopezmalla/spark,rezasafi/spark,zero323/spark,SnappyDataInc/spark,saltstar/spark,dbtsai/spark,minixalpha/spark,rezasafi/spark,hvanhovell/spark,witgo/spark,aokolnychyi/spark,BryanCutler/spark,kissmetrics/spark,icexelloss/spark,loneknightpy/spark,HyukjinKwon/spark,metamx/spark,minixalpha/spark,ueshin/apache-spark,patrick-nicholson/spark,mdespriee/spark,sahilTakiar/spark,pronix/spark,lxsmnv/spark,stanzhai/spark