def set(uri, user, passwd)
    if uri.nil?
      @cred = ["#{user}:#{passwd}"].pack('m').tr("\n", '')
    else
      uri = Util.uri_dirname(uri)
      @auth[uri] = ["#{user}:#{passwd}"].pack('m').tr("\n", '')
    end
  end
def set(uri, user, passwd)
    if uri.nil?
      @cred = ["#{user}:#{passwd}"].pack('m').tr("\n", '')
    else
      uri = Util.uri_dirname(uri)
      @auth[uri] = ["#{user}:#{passwd}"].pack('m').tr("\n", '')
    end
  end
uri == nil for generic purpose