Method: Remi::Extractor::SftpFile#extract

Defined in:
lib/remi/extractor/sftp_file.rb

#extractObject

Public: Called to extract files from the source filesystem.

Returns an array with containing the paths to all files extracted.



21
22
23
24
25
26
27
28
29
30
# File 'lib/remi/extractor/sftp_file.rb', line 21

def extract
  connection do |sftp|
    entries.map do |entry|
      local_file = File.join(@local_path, entry.name)
      @logger.info "Downloading #{entry.name} to #{local_file}"
      retry_download { sftp.download!(File.join(@remote_path, entry.name), local_file) }
      local_file
    end
  end
end