Esempio n. 1
0
        public FileDb CollectFilesFromDirectoryProvidedBySecretsAndSaveAsEmbed()
        {
            var dirName = this.Configuration["directoryName"];

            var specialDirPath =
                Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "\\" + dirName;

            var fileExists = File.Exists("first.embed");

            if (fileExists)
            {
                File.Delete("first.embed");
            }

            var embed = FileDb.NewFile("first.embed");

            var txtFiles = Directory.GetFiles(specialDirPath, "*");

            foreach (var file_ in txtFiles)
            {
                embed.CollectFile(file_, FileType.Text);
            }
            embed.Build();

            return(embed);
        }
Esempio n. 2
0
        public FileDb CollectFilesFromProvidedDirectoryAndSaveAsEmbed(
            string directoryPath)
        {
            var embed = FileDb.NewFile("first.embed");

            var txtFiles = Directory.GetFiles(directoryPath, "*");

            foreach (var file_ in txtFiles)
            {
                embed.CollectFile(file_, FileType.Text);
            }

            embed.Build();

            return(embed);
        }