Bloom.Book.BookMetaData.MetaDataPath C# (CSharp) Method

MetaDataPath() public static method

public static MetaDataPath ( string bookFolderPath ) : string
bookFolderPath string
return string
        public static string MetaDataPath(string bookFolderPath)
        {
            return bookFolderPath.CombineForPath(BookInfo.MetaDataFileName);
        }

Usage Example

Example #1
0
        static PublishSettings MigrateSettings(string bookFolderPath)
        {
            // See if we can migrate data from an old metaData.

            var metaDataPath = BookMetaData.MetaDataPath(bookFolderPath);
            var settings     = new PublishSettings();

            try
            {
                if (!RobustFile.Exists(metaDataPath))
                {
                    return(settings);
                }
                var metaDataString = RobustFile.ReadAllText(metaDataPath, Encoding.UTF8);

                // I chose to do this using DynamicJson, rather than just BloomMetaData.FromString() and
                // reading the obsolete properties, in hopes that we can eventually retire the obsolete
                // properties. However, that may not be possible without breaking things when we attempt
                // to load an old meta.json with JsonConvert. Still, at least this approach makes for
                // fewer warnings about use of obsolete methods.
                var metaDataJson = DynamicJson.Parse(metaDataString) as DynamicJson;
                if (metaDataJson.IsDefined("features"))
                {
                    if (metaDataJson.TryGet("features", out string[] features))