Revision 34bdb91d trunk/Pithos.Core/PithosMonitor.cs

b/trunk/Pithos.Core/PithosMonitor.cs
171 171
            
172 172

  
173 173
            CloudClient=new CloudFilesClient(UserName,ApiKey);
174
            var proxy = ProxyFromSettings(Settings);            
175
            CloudClient.Proxy = proxy;
176 174
            CloudClient.UsePithos = true;
177 175
            CloudClient.AuthenticationUrl = this.AuthenticationUrl;            
178 176

  
......
227 225

  
228 226
        public string AuthenticationUrl { get; set; }
229 227

  
230
        //TODO: Move this method somewhere else
231
        public static WebProxy ProxyFromSettings(IPithosSettings pithosSettings)
232
        {            
233
            if (pithosSettings.UseManualProxy)
234
            {
235
                var proxy = new WebProxy(pithosSettings.ProxyServer, pithosSettings.ProxyPort);
236
                //If the proxy requires specific authentication settings, use them
237
                if (pithosSettings.ProxyAuthentication)
238
                {
239
                    proxy.Credentials=new NetworkCredential(pithosSettings.ProxyUsername,pithosSettings.ProxyPassword,pithosSettings.ProxyDomain);
240
                }
241
                    //Otherwise, if there are generic authentication settings, use them
242
                if (!String.IsNullOrWhiteSpace(CredentialCache.DefaultNetworkCredentials.UserName))
243
                {
244
                    proxy.Credentials = CredentialCache.DefaultNetworkCredentials;
245
                }
246
                return proxy;
247
            }
248
            return null;
249
        }
250

  
251 228
        private void IndexLocalFiles()
252 229
        {
253 230
            StatusNotification.NotifyChange("Indexing Local Files",TraceLevel.Info);

Also available in: Unified diff