public override void Initialize(string name, System.Collections.Specialized.NameValueCollection config)
{
if (config == null)
{
throw new ArgumentNullException("config");
}
if (String.IsNullOrEmpty(name))
{
name = "UNCBlogProvider";
}
base.Initialize(name, config);
if (String.IsNullOrEmpty(config["description"]))
{
config.Remove("description");
config.Add("description", "Generic UNC File Path Blog Provider");
}
if (config["storageVariable"] == null)
{
// default to BlogEngine XML provider paths
config["storageVariable"] = HostingEnvironment.MapPath(Blog.CurrentInstance.StorageLocation);
}
else
{
if(config["storageVariable"].EndsWith(@"\"))
config["storageVariable"] = config["storageVariable"].Substring(0, config["storageVariable"].Length - 1);
if(!System.IO.Directory.Exists(config["storageVariable"]))
throw new ArgumentException("storageVariable (as unc path) does not exist. or does not have read\\write permissions");
}
this.uncPath = config["storageVariable"];
config.Remove("storageVariable");
}