/// <summary> /// 创建一个新实例 /// </summary> /// <param name="config">服务配置</param> /// <param name="qcloudCredentailProvider">凭证提供者</param> public CosXmlServer(CosXmlConfig config, QCloudCredentialProvider qcloudCredentailProvider) { if (config == null) { throw new CosClientException((int)CosClientError.InvalidArgument, "Config is null."); } this.config = config; if (this.config.IsDebugLog) { QLog.AddLogAdapter(new LogImpl()); } this.credentialProvider = qcloudCredentailProvider; httpClient = HttpClient.GetInstance(); httpClient.Init(this.config.HttpConfig); }
public CosXmlServer(CosXmlConfig config, QCloudCredentialProvider qcloudCredentailProvider) { if (config != null) { this.config = config; } else { this.config = new CosXmlConfig.Builder().Build(); } if (this.config.IsDebugLog) { QLog.AddLogAdapter(new LogImpl()); } this.qcloudCredentailProvider = qcloudCredentailProvider; HttpClient.Init(this.config.HttpConfig, this.qcloudCredentailProvider); httpClient = HttpClient.GetInstance(); }