class Aws::S3::FileDownloader

def multipart_download

def multipart_download
  resp = @client.head_object(bucket: @bucket, key: @key, part_number: 1)
  count = resp.parts_count
  if count.nil? || count <= 1
    resp.content_length < MIN_CHUNK_SIZE ?
      single_request :
      multithreaded_get_by_ranges(construct_chunks(resp.content_length))
  else
    # partNumber is an option
    resp = @client.head_object(bucket: @bucket, key: @key)
    resp.content_length < MIN_CHUNK_SIZE ?
      single_request :
      compute_mode(resp.content_length, count)
  end
end