示例#1
0
 public void NewDownload(string rootUri, string blobContainerName, string rootPath)
 {
     foreach (string localeUri in AzureUtils.ListCurrentDirectories(rootUri))
     {
         string locale;
         try
         {
             locale = localeUri.GetLastNPart('/');
         }
         catch
         {
             continue;
         }
         foreach (string timeStampUri in AzureUtils.ListCurrentDirectories(localeUri))
         {
             string   timeStamp = timeStampUri.GetLastNPart('/');
             DateTime dt        = DateTime.Parse(timeStamp);
             timeStamp = dt.ToString("yyyyMMdd");
             foreach (string speakerIdUri in AzureUtils.ListCurrentDirectories(timeStampUri))
             {
                 string speakerId       = timeStampUri.GetLastNPart('/');
                 string localFolderPath = Path.Combine(rootPath, locale, timeStamp, speakerId);
                 Directory.CreateDirectory(localFolderPath);
                 foreach (string azureFilePath in AzureUtils.ListCurrentBlobs(speakerIdUri))
                 {
                     string fileName      = azureFilePath.GetLastNPart('/');
                     string localFilePath = Path.Combine(localFolderPath, fileName);
                     AzureUtils.DownloadFile(azureFilePath, localFilePath);
                 }
             }
         }
     }
 }
示例#2
0
 private void Download(string inputAzureUri, string downloadFolder)
 {
     foreach (string azureFileName in AzureUtils.ListCurrentBlobs(inputAzureUri))
     {
         string fileName  = azureFileName.Split('/').Last();
         string localPath = Path.Combine(downloadFolder, fileName);
         AzureUtils.DownloadFile(azureFileName, localPath);
     }
 }