static String downloadFile ( String artifactUrl , String checksum ) { LOGGER . entering ( new Object [ ] { artifactUrl , checksum } ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( artifactUrl ) , "Invalid URL: Cannot be null or empty" ) ; Preconditions . checkArgument ( StringUtils . isNotBlank ( checksum ) , "Invalid CheckSum: Cannot be null or empty" ) ; // Making sure only the files supported go through the download and extraction. isValidFileType ( artifactUrl ) ; String algorithm = null ; if ( isValidSHA1 ( checksum ) ) { algorithm = "SHA1" ; } else if ( isValidMD5 ( checksum ) ) { algorithm = "MD5" ; } String result = downloadFile ( artifactUrl , checksum , algorithm ) ; LOGGER . exiting ( result ) ; return result ; }
Download a file from the specified url