/// <summary> /// Ensures the folder exists. /// </summary> /// <param name="folder">The folder.</param> /// <param name="destinationFolderUrl">The destination folder URL.</param> /// <param name="emailUploadFile">The email upload file.</param> /// <param name="fields">The fields.</param> /// <param name="fieldInformations">The field informations.</param> /// <param name="sharePointListViewControl">The share point list view control.</param> /// <returns>The url of the new folder.</returns> private string ensureFolderExists(EUFolder folder, string destinationFolderUrl, EUEmailUploadFile emailUploadFile, List <EUField> fields, EUFieldInformations fieldInformations, SharePointListViewControl sharePointListViewControl) { string newFolderName = SharePointManager.MakeFileNameSafe(emailUploadFile.Subject + (emailUploadFile.SentOn.HasValue ? emailUploadFile.SentOn.Value.ToString(" yyyyddMM") : "")); string newDestinationUrl = destinationFolderUrl + "/" + newFolderName; if (!SharePointManager.CheckFolderExists(folder.SiteSetting, newDestinationUrl, folder.ListName, folder.FolderPath, newFolderName)) { SharePointManager.CreateListFolder(folder.SiteSetting, folder.FolderPath, folder.WebUrl, folder.ListName, newFolderName); } // JOEL JEFFERY 20110712 - what the hell was I thinking? //folder.FolderPath = folder.FolderPath += "/" + newFolderName; return(newDestinationUrl); }