src/NuGetGallery/Services/PackageFileService.cs
/// <summary>
/// Downloads the readme.md from storage.
/// </summary>
/// <param name="package">The package associated with the readme.</param>
Downloads the readme.md from storage.
Downloads the readme . md from storage .
public async Task<string> DownloadReadMeMdFileAsync(Package package)
        {
            if (package == null)
            {
                throw new ArgumentNullException(nameof(package));
            }
            var fileName = FileNameHelper.BuildFileName(package, ReadMeFilePathTemplateActive, ServicesConstants.MarkdownFileExtension);
            using (var readMeMdStream = await _fileStorageService.GetFileAsync(CoreConstants.Folders.PackageReadMesFolderName, fileName))
            {
                if (readMeMdStream != null)
                {
                    using (var readMeMdReader = new StreamReader(readMeMdStream))
                    {
                        return await readMeMdReader.ReadToEndAsync();
                    }
                }
            }
            return null;
        }
public async Task < string > DownloadReadMeMdFileAsync ( Package package ) { if ( package == null ) { throw new ArgumentNullException ( nameof ( package ) ) ; } var fileName = FileNameHelper . BuildFileName ( package , ReadMeFilePathTemplateActive , ServicesConstants . MarkdownFileExtension ) ; using ( var readMeMdStream = await _fileStorageService . GetFileAsync ( CoreConstants . Folders . PackageReadMesFolderName , fileName ) ) { if ( readMeMdStream != null ) { using ( var readMeMdReader = new StreamReader ( readMeMdStream ) ) { return await readMeMdReader . ReadToEndAsync ( ) ; } } } return null ; }
Downloads the readme.md from storage.
Downloads the readme . md from storage .
// Note that fileStorageService implementations return null if not found.
package
Package
The package associated with the readme.
The package associated with the readme .