Method: Remi::Extractor::SftpFile#extract

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

#extractArray<String>

Called to extract files from the source filesystem.

Returns:

  • (Array<String>)

    An array of paths to a local copy of the files extacted



57
58
59
60
61
62
63
64
65
66
67
# File 'lib/remi/data_subjects/sftp_file.rb', line 57

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