# File lib/chef/file_cache.rb, line 67 def move_to(file, path) validate( { :file => file, :path => path }, { :file => { :kind_of => String }, :path => { :kind_of => String }, } ) file_path_array = File.split(path) file_name = file_path_array.pop if File.exists?(file) && File.writable?(file) FileUtils.mv( file, File.join(create_cache_path(File.join(file_path_array), true), file_name) ) else raise RuntimeError, "Cannot move #{file} to #{path}!" end end