def get_object(obj_path, opts = {})
      url     = obj_url(obj_path)
      headers = gen_headers(opts)

      attempt(opts[:attempts]) do
        method = opts[:head] ? :head : :get
        result = @client.send(method, url, nil, headers)
        raise unless result.is_a? HTTP::Message

        if result.status == 200
          return true, result.headers if method == :head

          sent_md5     = result.headers['Content-MD5']
          received_md5 = Digest::MD5.base64digest(result.body)
          raise CorruptResult if sent_md5 != received_md5

          return result.body, result.headers
        elsif result.status == 304
          return nil, result.headers
        end

        raise_error(result)
      end
    end
def get_object(obj_path, opts = {})
      url     = obj_url(obj_path)
      headers = gen_headers(opts)

      attempt(opts[:attempts]) do
        method = opts[:head] ? :head : :get
        result = @client.send(method, url, nil, headers)
        raise unless result.is_a? HTTP::Message

        if result.status == 200
          return true, result.headers if method == :head

          sent_md5     = result.headers['Content-MD5']
          received_md5 = Digest::MD5.base64digest(result.body)
          raise CorruptResult if sent_md5 != received_md5

          return result.body, result.headers
        elsif result.status == 304
          return nil, result.headers
        end

        raise_error(result)
      end
    end
Get an object from Manta at a given path, and checks it's uncorrupted.

 The path must start with /<user>/stor or /<user/public and point at an
 actual object, as well as output objects for jobs. :head => true can
 optionally be passed in to do a HEAD instead of a GET.

 Returns the retrieved data along with received HTTP headers.

 If there was an unrecoverable error, throws an exception. On connection or
 corruption errors, more attempts will be made; the number of attempts can
 be altered by passing in :attempts.