Method: OmfCommon::Comm::AMQP::Communicator#receive_file

Defined in:
lib/omf_common/comm/amqp/amqp_communicator.rb

#receive_file(topic_url, file_path = nil, opts = {}, &block) ⇒ Object



121
122
123
124
125
126
127
128
# File 'lib/omf_common/comm/amqp/amqp_communicator.rb', line 121

def receive_file(topic_url, file_path = nil, opts = {}, &block)
  if topic_url.start_with? @address_prefix
    topic_url = topic_url[@address_prefix.length .. -1]
  end
  require 'omf_common/comm/amqp/amqp_file_transfer'
  file_path ||= File.join(Dir.tmpdir, Dir::Tmpname.make_tmpname('bdcast', '.xxx'))
  FileReceiver.new(file_path, @channel, topic_url, opts, &block)
end