/// <summary>
/// Gets a file in the specified branding folder
/// </summary>
/// <param name="brandingNameOrFolderPath"> Normally, the branding is just a name, which we look up in the official branding folder
// but unit tests can instead provide a path to the folder.
/// </param>
/// <param name="fileName"></param>
/// <returns></returns>
public static string GetOptionalBrandingFile(string brandingNameOrFolderPath, string fileName)
{
if (Path.IsPathRooted(brandingNameOrFolderPath)) //if it looks like a path
{
var path = Path.Combine(brandingNameOrFolderPath, fileName);
if (RobustFile.Exists(path))
{
return(path);
}
return(null);
}
if (Path.IsPathRooted(fileName) && RobustFile.Exists(fileName)) // also just for unit tests
{
return(fileName);
}
return(BloomFileLocator.GetBrowserFile(true, "branding", brandingNameOrFolderPath, fileName));
}