Exemple #1
0
        private async Task <string> CreateFileInStore(IFileStore fileStore, string fileName)
        {
            string token = await fileStore.CreateFileToken(fileName);

            await using (var writer = await fileStore.OpenWrite(token))
            {
                writer.Write(Encoding.UTF8.GetBytes(Content));
                await writer.FlushAsync();
            }
            return(token);
        }
Exemple #2
0
        private async Task <string> CreateGZipFileInStore(IFileStore fileStore, string fileName)
        {
            string token = await fileStore.CreateFileToken(fileName);

            await using (var writer = await fileStore.OpenWrite(token))
                await using (var zipStream = new GZipStream(writer, CompressionMode.Compress))
                {
                    zipStream.Write(Encoding.UTF8.GetBytes(Content));
                    await zipStream.FlushAsync();
                }

            return(token);
        }