Subtext.Providers.BlogEntryEditor.FCKeditor.FileBrowserConnector.CreateImageFolder C# (CSharp) Method

CreateImageFolder() private static method

private static CreateImageFolder ( XmlNode connectorNode ) : bool
connectorNode System.Xml.XmlNode
return bool
        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;
        }