private static WebPageMatch MatchDefaultFiles(string pathValue, string[] supportedExtensions, Func<string, bool> virtualPathExists, HttpContextBase context, DisplayModeProvider displayModes, string currentLevel)
{
// If we haven't found anything yet, now try looking for default.* or index.* at the current url
currentLevel = pathValue;
string currentLevelIndex;
if (String.IsNullOrEmpty(currentLevel))
{
currentLevelIndex = "index";
}
else
{
if (currentLevel[currentLevel.Length - 1] != '/')
{
currentLevel += "/";
}
currentLevelIndex = currentLevel + "index";
}
// Does the current route level match any supported extension?
string indexMatch = GetRouteLevelMatch(currentLevelIndex, supportedExtensions, virtualPathExists, context, displayModes);
if (indexMatch != null)
{
return new WebPageMatch(indexMatch, String.Empty);
}
return null;
}
}