def upload_image
      uploader = SFTPHelper.new(:log => @log)

      #SFTP library automagically uses keys registered with the OS first before trying a password.
      uploader.connect(@image_delivery_uri.host,
      (@image_delivery_uri.user || Etc.getlogin),
      :password => @image_delivery_uri.password)

      uploader.upload_files(@image_delivery_uri.path,
                            @default_permissions,
                            @overwrite,
                            File.basename(@previous_deliverables.disk) => @previous_deliverables.disk)
    ensure
      uploader.disconnect if uploader.connected?
    end
def upload_image
      uploader = SFTPHelper.new(:log => @log)

      #SFTP library automagically uses keys registered with the OS first before trying a password.
      uploader.connect(@image_delivery_uri.host,
      (@image_delivery_uri.user || Etc.getlogin),
      :password => @image_delivery_uri.password)

      uploader.upload_files(@image_delivery_uri.path,
                            @default_permissions,
                            @overwrite,
                            File.basename(@previous_deliverables.disk) => @previous_deliverables.disk)
    ensure
      uploader.disconnect if uploader.connected?
    end
Upload an image via SFTP