private static bool CreateImageFolder(XmlNode connectorNode)
{
bool retval;
string blogImageRootPath=null;
try
{
blogImageRootPath = UrlFormats.StripHostFromUrl(Config.CurrentBlog.ImagePath);
if (!Directory.Exists(HttpContext.Current.Server.MapPath(blogImageRootPath)))
Directory.CreateDirectory(HttpContext.Current.Server.MapPath(blogImageRootPath));
retval = true;
}
catch (Exception)
{
// Create the "Error" node.
XmlNode oErrorNode = XmlUtil.AppendElement(connectorNode, "Error");
XmlUtil.SetAttribute(oErrorNode, "number", "1");
XmlUtil.SetAttribute(oErrorNode, "text", "Cannot create folder: " + HttpContext.Current.Server.MapPath(blogImageRootPath) + ".\r\nWrite access to this folder is required to initialize the image storage");
retval = false;
}
return retval;
}