+ def download(url, outfile, headers = {}, continue = false)
+ if (continue == false and File.exists?(outfile))
+ raise IOError.new("Output file already exists. Please remove #{outfile}, and try again. If this is a partially-downloaded file, you can use the --continue flag to pick up where it left off.")
+ end
+
+ options = ''
+
+ if continue == true
+ options += '--continue '
+ end
+
+ headers.each_key do |key|
+ options += "--header '#{key}: #{headers[key]}' "
+ end
+