private bool IsExcluded(string topPath)
{
var position = topPath.IndexOf('/');
if (position <= 0)
{
return false;
}
// Remove Site name
var path = topPath.Substring(position + 1);
if (_directoriesToExclude.Contains(path, StringComparer.OrdinalIgnoreCase))
{
return true;
}
return _directoriesToExclude.Any(toExclude => path.StartsWith(toExclude + "/"));
}