Beispiel #1
0
        /// <summary>
        /// Create the folders from the xlsx file under the folder named passed as input.
        /// </summary>
        /// <param name="folderName">Name of the root folder to create the folders under. Leave empty to default to "Building Blocks".</param>
        public void CreateFolders(string folderName = null)
        {
            foreach (var folderPath in ExcelReader.PendingItems)
            {
                var folderWebdav = WebDavBase;
                folderWebdav += Constants.BuildingBlocks;

                // Add the folder subpath if passed in.
                folderWebdav += !string.IsNullOrEmpty(folderName)
                    ? Constants.Slash + folderName
                    : string.Empty;
                folderWebdav += Constants.Slash + folderPath;

                FolderBuilder.RootFolderWebDav  = WebDavBase + folderName;
                FolderBuilder.CreatedFolderPath = folderPath;

                Console.WriteLine($"Creating folder at path {folderWebdav}");
                FolderBuilder.GetOrCreateOrganizationalItem(folderWebdav);
            }
        }