Sha256: e3e30cb0c613ad531dd1dc7e9eaf1784964af4c6d35f08ea539c74e9de0be450

Contents?: true

Size: 827 Bytes

Versions: 6

Compression:

Stored size: 827 Bytes

Contents

module Fog
  module Storage
    class Aliyun
      class Real
        # Get headers for object
        #
        # ==== Parameters
        # * object<~String> - Name of object to look for
        #
        def head_object(object, options = {})
          bucket = options[:bucket]
          bucket ||= @aliyun_oss_bucket
          location = get_bucket_location(bucket)
          endpoint = 'http://' + location + '.aliyuncs.com'
          resource = bucket + '/' + object
          ret = request(
            expects: [200, 404],
            method: 'HEAD',
            path: object,
            bucket: bucket,
            resource: resource,
            endpoint: endpoint
          )
          ret
        end
      end

      class Mock
        def head_object(object, options = {})
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
fog-aliyun-0.3.0 lib/fog/aliyun/requests/storage/head_object.rb
fog-aliyun-0.2.2 lib/fog/aliyun/requests/storage/head_object.rb
fog-xiaozhu-0.2.2 lib/fog/aliyun/requests/storage/head_object.rb
fog-xiaozhu-0.2.1 lib/fog/aliyun/requests/storage/head_object.rb
fog-aliyun-0.2.1 lib/fog/aliyun/requests/storage/head_object.rb
fog-aliyun-0.2.0 lib/fog/aliyun/requests/storage/head_object.rb