MCPcopy Create free account
hub / github.com/apache/arrow / download

Method download

dev/tasks/linux-packages/package-task.rb:80–98  ·  view source on GitHub ↗
(url, output_path)

Source from the content-addressed store, hash-verified

78 end
79
80 def download(url, output_path)
81 if File.directory?(output_path)
82 base_name = url.split("/").last
83 output_path = File.join(output_path, base_name)
84 end
85 absolute_output_path = File.expand_path(output_path)
86
87 unless File.exist?(absolute_output_path)
88 mkdir_p(File.dirname(absolute_output_path))
89 rake_output_message "Downloading... #{url}"
90 open_url(url) do |downloaded_file|
91 File.open(absolute_output_path, "wb") do |output_file|
92 IO.copy_stream(downloaded_file, output_file)
93 end
94 end
95 end
96
97 absolute_output_path
98 end
99
100 def open_url(url, &block)
101 URI(url).open(&block)

Callers

nothing calls this directly

Calls 4

directory?Method · 0.80
exist?Method · 0.80
joinMethod · 0.45
openMethod · 0.45

Tested by

no test coverage detected