downloadFile

open fun downloadFile(url: String, pathName: String, save: Boolean): File

Method to download a file from an "URL" source

Return

file downloaded as File

Parameters

url

: source URL from download the file

pathName

: path name for the file, this must include also the suffix e.g. -> download.{suffix}

save

: flag whether save the file, if is set to "false" will be created a temporary file that will be deleted on exit

Throws

when path name is invalid or an error occurred during the download of the file