def incrementally_list_bucket(bucket, options={}, headers={}, &block)
internal_options = options.symbolize_keys
begin
internal_bucket = bucket.dup
internal_bucket += '?'+internal_options.map{|k, v| "#{k.to_s}=#{CGI::escape v.to_s}"}.join('&') unless internal_options.blank?
req_hash = generate_rest_request('GET', headers.merge(:url=>internal_bucket))
response = request_info(req_hash, S3ImprovedListBucketParser.new(:logger => @logger))
there_are_more_keys = response[:is_truncated]
if(there_are_more_keys)
internal_options[:marker] = decide_marker(response)
total_results = response[:contents].length + response[:common_prefixes].length
internal_options['max-keys''max-keys'] ? (internal_options['max-keys''max-keys'] -= total_results) : nil
end
yield response
end while there_are_more_keys && under_max_keys(internal_options)
true
rescue
on_exception
end