class OpenUriDownloader < Downloader
- def download(url, outfile)
+ def download(url, outfile, headers = {}, continue = false)
+ if File.exists?(outfile)
+ raise IOError.new("Output file already exists. Please remove #{outfile}, and try again.")
+ end
+
uri = URI.parse(url)
uu = UriUtilities.new()
puts "Fetching #{url}"
puts "Saving as #{outfile}."
puts ''
- uu.download_with_progress_bar(uri, outfile)
+ uu.download_with_progress_bar(uri, outfile, headers)
end
end