/// <summary> /// Downloads remote direactory as zip to stream. /// </summary> /// <param name="client">The Kudu client.</param> /// <param name="remotePath">The remote source path.</param> /// <returns>Content as <see cref="Stream"/></returns> /// <example> /// <code> /// #addin nuget:?package=Cake.Kudu.Client /// /// string baseUri = EnvironmentVariable("KUDU_CLIENT_BASEURI"), /// userName = EnvironmentVariable("KUDU_CLIENT_USERNAME"), /// password = EnvironmentVariable("KUDU_CLIENT_PASSWORD"); /// /// IKuduClient kuduClient = KuduClient( /// baseUri, /// userName, /// password); /// /// DirectoryPath remoteDirectoryPath = "/site/wwwroot/assets/"; /// /// Stream resultStream = kuduClient.ZipDownloadStream(remoteDirectoryPath); /// /// Information("Result length: {0}", resultStream.Length); /// </code> /// </example> public static Stream ZipDownloadStream( this IKuduClient client, DirectoryPath remotePath) { return(client.DownloadStream(remotePath, EncodeZipPath)); }
/// <summary> /// Downloads remote file to stream /// </summary> /// <param name="client">The Kudu client.</param> /// <param name="remotePath">The remote source path.</param> /// <returns>Content as <see cref="Stream"/></returns> /// <example> /// <code> /// #addin nuget:?package=Cake.Kudu.Client /// /// string baseUri = EnvironmentVariable("KUDU_CLIENT_BASEURI"), /// userName = EnvironmentVariable("KUDU_CLIENT_USERNAME"), /// password = EnvironmentVariable("KUDU_CLIENT_PASSWORD"); /// /// IKuduClient kuduClient = KuduClient( /// baseUri, /// userName, /// password); /// /// FilePath remoteFilePath = "/site/wwwroot/hello.txt"; /// /// Stream resultStream = kuduClient.VFSDownloadStream(remoteFilePath); /// /// Information("Result length: {0}", resultStream.Length); /// </code> /// </example> // ReSharper disable once InconsistentNaming public static Stream VFSDownloadStream( this IKuduClient client, FilePath remotePath) { return(client.DownloadStream(remotePath, EncodeVFSPath)); }