WikiCrawler/Batch/BatchUploader.cs
/// <summary>
/// If the image for the specified item isn't cached, caches it.
/// </summary>
If the image for the specified item isn't cached, caches it.
If the image for the specified item isn ' t cached caches it .
public virtual void CacheImage(string key, Dictionary<string, string> metadata)
	{
		if (m_config.allowImageDownload)
		{
			string imagepath = GetImageCacheFilename(key, metadata);
			if (!File.Exists(imagepath))
			{
				Console.WriteLine("Downloading image: " + key);
				Uri uri = GetImageUri(key, metadata);
				EasyWeb.WaitForDelay(uri);
				s_client.DownloadFile(uri, imagepath);
				try
				{
					ValidateDownload(imagepath);
				}
				catch (Exception)
				{
					File.Delete(imagepath);
					throw;
				}
			}
		}
	}
public virtual void CacheImage ( string key , Dictionary < string , string > metadata ) { if ( m_config . allowImageDownload ) { string imagepath = GetImageCacheFilename ( key , metadata ) ; if ( ! File . Exists ( imagepath ) ) { Console . WriteLine ( " " + key ) ; Uri uri = GetImageUri ( key , metadata ) ; EasyWeb . WaitForDelay ( uri ) ; s_client . DownloadFile ( uri , imagepath ) ; try { ValidateDownload ( imagepath ) ; } catch ( Exception ) { File . Delete ( imagepath ) ; throw ; } } } }
If the image for the specified item isn't cached, caches it.
If the image for the specified item isn ' t cached caches it .
key
string
metadata
Dictionary<string, string>