Frapid.WebsiteBuilder.Models.Themes.ThemeUploader.CopyTheme C# (CSharp) Method

CopyTheme() public method

public CopyTheme ( string tenant ) : void
tenant string
return void
        public void CopyTheme(string tenant)
        {
            string source = this.ExtractedDirectory;
            string destination =
                HostingEnvironment.MapPath(
                    $"~/Tenants/{tenant}/Areas/Frapid.WebsiteBuilder/Themes/{this.ThemeInfo.ThemeName}");

            if (destination == null)
            {
                Log.Warning("Could not copy theme because the destination directory could not be located.");
                throw new ThemeInstallException("Could not install theme. Check application logs for more information.");
            }

            if (Directory.Exists(destination))
            {
                throw new ThemeInstallException("Could not install theme because it already exists.");
            }

            FileHelper.CopyDirectory(source, destination);
        }