private static string GetSiteName(IEnvironment environment)
{
// Try to get the site name from the environment (WAWS will set it)
string siteName = ServerConfiguration.GetApplicationName();
if (String.IsNullOrEmpty(siteName))
{
// Otherwise get it from the root directory name
siteName = Path.GetFileName(environment.RootPath);
}
return siteName;
}
}