# File lib/aws/s3/data_options.rb, line 65
      def validate_data! options, block

        data = options[:data]
        filename = options[:file]

        raise ArgumentError, 'data passed multiple ways' if
          [data, filename, block].compact.size > 1

        # accepting block format
        return if block and block.arity == 1

        # accepting file path
        return if filename.kind_of?(String)

        # accepting strings
        return if data.kind_of?(String)

        # accepting pathname
        return if data.kind_of?(Pathname)

        # accepts io-like objects (responds to read and eof?)
        if data.respond_to?(:read) and 
            data.method(:read).arity != 0 and
            data.respond_to?(:eof?) then
          return true
        end

        raise ArgumentError, 'data must be provided as a String, ' +
          'Pathname, file path, or an object that responds to #read and #eof?'

      end