protected virtual void AddWebsiteToProjectMappings([NotNull] ParsePathMappersPipeline pipeline)
        {
            var defaultDatabase = pipeline.Configuration.GetString(Constants.Configuration.Database, "master");

            foreach (var pair in pipeline.Configuration.GetSubKeys("project-website-mappings:website-to-project"))
            {
                var key = "project-website-mappings:website-to-project:" + pair.Key;

                var itemPathToProjectDirectory = pipeline.Configuration.GetString(key + ":item-path-to-project-directory");
                if (!string.IsNullOrEmpty(itemPathToProjectDirectory))
                {
                    var n = itemPathToProjectDirectory.IndexOf("=>", StringComparison.Ordinal);
                    if (n < 0)
                    {
                        throw new ConfigurationException(Texts.Missing_Mapping);
                    }

                    var databaseName        = pipeline.Configuration.GetString(key + ":database", defaultDatabase);
                    var itemPath            = itemPathToProjectDirectory.Left(n).Trim();
                    var projectDirectory    = itemPathToProjectDirectory.Mid(n + 2).Trim();
                    var format              = pipeline.Configuration.GetString(key + ":format", "item.json");
                    var itemNameInclude     = pipeline.Configuration.GetString(key + ":item-name-include");
                    var itemNameExclude     = pipeline.Configuration.GetString(key + ":item-name-exclude");
                    var templateNameInclude = pipeline.Configuration.GetString(key + ":template-name-include");
                    var templateNameExclude = pipeline.Configuration.GetString(key + ":template-name-exclude");

                    var itemNamePathMatcher     = GetItemPathPathMatcher(itemPath, itemNameInclude, itemNameExclude);
                    var templateNamePathMatcher = GetItemPathPathMatcher(itemPath, templateNameInclude, templateNameExclude);

                    var websiteItemPathToProjectDirectoryMapper = new WebsiteItemPathToProjectDirectoryMapper(itemNamePathMatcher, templateNamePathMatcher, databaseName, itemPath, projectDirectory, format);
                    pipeline.WebsiteItemPathToProjectDirectories.Add(websiteItemPathToProjectDirectoryMapper);
                }

                var projectDirectoryToWebsiteDirectory = pipeline.Configuration.GetString(key + ":website-directory-to-project-directory");
                if (!string.IsNullOrEmpty(projectDirectoryToWebsiteDirectory))
                {
                    var n = projectDirectoryToWebsiteDirectory.IndexOf("=>", StringComparison.Ordinal);
                    if (n < 0)
                    {
                        throw new ConfigurationException(Texts.Missing_Mapping);
                    }

                    var websiteDirectory = projectDirectoryToWebsiteDirectory.Left(n).Trim();
                    var projectDirectory = projectDirectoryToWebsiteDirectory.Mid(n + 2).Trim();
                    var include          = pipeline.Configuration.GetString(key + ":file-name-include");
                    var exclude          = pipeline.Configuration.GetString(key + ":file-name-exclude");

                    var pathMatcher = GetFileNamePathMatcher(websiteDirectory, include, exclude);

                    var websiteDirectoryToProjectDirectoryMapper = new WebsiteDirectoryToProjectDirectoryMapper(pathMatcher, websiteDirectory, projectDirectory);
                    pipeline.WebsiteDirectoryToProjectDirectories.Add(websiteDirectoryToProjectDirectoryMapper);
                }
            }
        }
        public void WebsiteItemPathToProjectFileNameTests()
        {
            var pathMapperService = new PathMapperService();

            var itemNamePathMatcher = new PathMatcher("\\sitecore\\content\\Home\\CleanBlog\\**", string.Empty);

            var websiteItemPathToProjectDirectoryMapper = new WebsiteItemPathToProjectDirectoryMapper(itemNamePathMatcher, null, "master", "/sitecore/content/Home", "/content/master/sitecore/content/Home", "item.json");

            pathMapperService.WebsiteItemPathToProjectDirectories.Add(websiteItemPathToProjectDirectoryMapper);

            string projectFileName;
            string format;
            var    condition = pathMapperService.TryGetProjectFileName("/sitecore/content/Home/CleanBlog/Posts/Post1", string.Empty, out projectFileName, out format);

            Assert.IsTrue(condition);
            Assert.AreEqual("content\\master\\sitecore\\content\\Home\\CleanBlog\\Posts\\Post1.item.json", projectFileName);
            Assert.AreEqual("item.json", format);

            Assert.IsFalse(pathMapperService.TryGetProjectFileName("/sitecore/content/Home/TodoMvc/Posts/Post1", string.Empty, out projectFileName, out format));
        }