Class: Vagrant::Downloaders::File

Inherits:
Base
  • Object
show all
Defined in:
lib/vagrant/downloaders/file.rb

Overview

“Downloads” a file to a temporary file. Basically, this downloader simply does a file copy.

Instance Method Summary collapse

Methods included from Util

#error_and_exit, included, #logger, #wrap_output

Instance Method Details

#download!(source_url, destination_file) ⇒ Object



12
13
14
# File 'lib/vagrant/downloaders/file.rb', line 12

def download!(source_url, destination_file)
  FileUtils.cp(source_url, destination_file.path)
end

#prepare(source_url) ⇒ Object



6
7
8
9
10
# File 'lib/vagrant/downloaders/file.rb', line 6

def prepare(source_url)
  if !::File.file?(source_url)
    raise Actions::ActionException.new(:downloader_file_doesnt_exist, :source_url => source_url)
  end
end