    # File lib/fog/aws/storage.rb, line 266
            def initialize(options={})
              require 'fog/core/parser'
              require 'mime/types'

              @use_iam_profile = options[:use_iam_profile]
              setup_credentials(options)
              @connection_options     = options[:connection_options] || {}

              if @endpoint = options[:endpoint]
                endpoint = URI.parse(@endpoint)
                @host = endpoint.host
                @path = if endpoint.path.empty?
                  '/'
                else
                  endpoint.path
                end
                @port = endpoint.port
                @scheme = endpoint.scheme
              else
                options[:region] ||= 'us-east-1'
                @region = options[:region]
                @host = options[:host] || case options[:region]
                when 'us-east-1'
                  's3.amazonaws.com'
                else
                  "s3-#{options[:region]}.amazonaws.com"
                end
                @path       = options[:path]        || '/'
                @persistent = options.fetch(:persistent, false)
                @port       = options[:port]        || 443
                @scheme     = options[:scheme]      || 'https'
              end
              @connection = Fog::Connection.new("#{@scheme}://#{@host}:#{@port}#{@path}", @persistent, @connection_options)
            end