Example #1
0
        protected string GetFile(FileType fileType, string filename)
        {
            var path      = Path.Combine(DemoDirectory, filename);
            var extension = fileExtensionManager.GetExtension(fileType);

            return($"{path}.{extension}");
        }
        protected string[] GetFilepaths(User user, FileType fileType)
        {
            var folder = GetFolder(user, fileType);

            if (!Directory.Exists(folder))
            {
                return(new string[0]);
            }

            var extension = fileExtensionGetter.GetExtension(fileType);
            var filepaths = Directory.GetFiles(folder, $"*.{extension}");

            filepaths = filepaths.Where((path) => path.EndsWith(extension, StringComparison.InvariantCultureIgnoreCase)).ToArray();

            return(filepaths);
        }