KuduClientVFSExtensions.

VFSList(IKuduClient, DirectoryPath) Method

Summary

Lists remote resources for a given path.

Syntax

public static IKuduVFS VFSList(this IKuduClient client, DirectoryPath remotePath)

Examples

 #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 remotePath = "/site/wwwroot";

 IKuduVFS kuduVFS = kuduClient.VFSList(remotePath);

 Information("Directories and files");
 foreach(IKuduPath path in kuduVFS.Entries)
 {
     Information(
         "Name: {0}, Size: {1}, Created: {2:yyyy-MM-dd HH:mm:ss}, Modified: {3:yyyy-MM-dd HH:mm:ss}, Mime: {4}",
         path.Name,
         path.Size,
         path.Created,
         path.Modified,
         path.Mime);
 }

 Information("Directories");
 foreach(IKuduDirectoryPath directoryPath in kuduVFS.Directories)
 {
     Information(
         "Directory: {0}, Size: {1}, Created: {2:yyyy-MM-dd HH:mm:ss}, Modified: {3:yyyy-MM-dd HH:mm:ss}, Mime: {4}, Path: {5}",
         directoryPath.Name,
         directoryPath.Size,
         directoryPath.Created,
         directoryPath.Modified,
         directoryPath.Mime,
         directoryPath.Path);
 }

 Information("Files");
 foreach(IKuduFilePath filePath in kuduVFS.Files)
 {
     Information(
         "File: {0}, Size: {1}, Created: {2:yyyy-MM-dd HH:mm:ss}, Modified: {3:yyyy-MM-dd HH:mm:ss}, Mime: {4}, Path: {5}",
         filePath.Name,
         filePath.Size,
         filePath.Created,
         filePath.Modified,
         filePath.Mime,
         filePath.Path);
 }

Parameters

Name Type Description
client IKuduClient The Kudu client.
remotePath DirectoryPath The remote directory path.

Return Value

Type Description
IKuduVFS IKuduVFS instance containing remote directory and file paths.