예제 #1
0
        public Reader(string magicFilename, EMagicFileType fileType)
        {
            if (File.Exists(magicFilename))
            {
                switch (fileType)
                {
                case EMagicFileType.Json:
                    _types = ReadJson(magicFilename);
                    break;

                case EMagicFileType.Original:
                    _types = ReadOriginal(magicFilename);
                    break;
                }
            }
            else
            {
                throw new FileNotFoundException($"File does not exist: {magicFilename}");
            }
        }
예제 #2
0
 public MimeMagicSharp(EMagicFileType magicFileType, string magicFilePath)
 {
     _mimeReader = new Reader(magicFilePath, magicFileType);
 }