namespace Core.Utility;

public static class FileUtility
{
    public static FileInfo GetContentFile(string contentDirectory, string fileName, bool useAssemblyDirectory = false)
    {
        string basePath;
        //if (useAssemblyDirectory)
        //    basePath = AssemblyDirectory;
        //else
            basePath = AppDomain.CurrentDomain.BaseDirectory;
        var path = Path.Combine(basePath, contentDirectory);
        return new FileInfo(path + fileName);
    }

    //public static string AssemblyDirectory
    //{
    //    get
    //    {
    //        var codeBase = Assembly.GetExecutingAssembly().Location;
    //        var uri = new UriBuilder(codeBase);
    //        var path = Uri.UnescapeDataString(uri.Path);
    //        return Path.GetDirectoryName(path);
    //    }
    //}
}