~ubuntu-branches/ubuntu/wily/ruby-aws-sdk/wily

« back to all changes in this revision

Viewing changes to lib/aws/s3/client.rb

  • Committer: Package Import Robot
  • Author(s): David Suárez
  • Date: 2015-08-11 17:43:39 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20150811174339-xpq5x98u1udacu7q
Tags: 1.64.0-1
* debian/control:
  - Update standards version; no changes needed.
  - Add Conflicts: ruby-aws; Distinct implementation for same service.
* debian/patches:
  - Drop 'fix-typo-in-aws-repl-commandline-client-help-page' path;
      applied upstream.
  - Refresh 'use-correct-path-for-bundled-files' patch.
  - Add 'maintain-imports-backwards-compatibility patch'.
* debian/copyright: update years.

Show diffs side-by-side

added added

removed removed

Lines of Context:
26
26
    # Client class for Amazon Simple Storage Service (S3).
27
27
    class Client < Core::Client
28
28
 
 
29
      include RegionDetection
 
30
 
 
31
      def initialize(options = {})
 
32
        super(options.merge(:http_continue_threshold => 0))
 
33
      end
 
34
 
29
35
      signature_version :S3
30
36
 
31
37
      API_VERSION = '2006-03-01'
51
57
      # @param [Core::Http::Request] request
52
58
      # @api private
53
59
      def sign_request request
54
 
        version = @config.s3_signature_version ?
55
 
          @config.s3_signature_version.to_sym :
56
 
          (@region =~ /cn-/ ? :v4 : :v3)
57
 
        case version
 
60
        case @config.s3_signature_version.to_sym
58
61
        when :v4 then v4_signer.sign_request(request)
59
62
        when :v3 then v3_signer.sign_request(request)
60
63
        else
61
 
          raise "invalid signature version #{version.inspect}"
 
64
          raise "invalid signature version #{@config.s3_signature_version.inspect}"
62
65
        end
63
66
      end
64
67
 
1417
1420
      #   @param [Hash] options
1418
1421
      #   @option options [required,String] :bucket_name
1419
1422
      #   @option options [required,String] :key
 
1423
      #   @option options [String] :request_payer If specified, the request
 
1424
      #     will contain the specified String value in the x-amz-request-payer
 
1425
      #     header. This is required for Requester Pays enabled buckets.
1420
1426
      #   @option options [Time] :if_modified_since If specified, the
1421
1427
      #     response will contain an additional `:modified` value that
1422
1428
      #     returns true if the object was modified after the given
1454
1460
      #
1455
1461
      object_method(:get_object, :get,
1456
1462
                    :header_options => {
 
1463
                      :request_payer => "x-amz-request-payer",
1457
1464
                      :if_modified_since => "If-Modified-Since",
1458
1465
                      :if_unmodified_since => "If-Unmodified-Since",
1459
1466
                      :if_match => "If-Match",