protected override async Task <List <string> > GetFilesForRestore()
        {
            var prefix     = string.IsNullOrEmpty(_remoteFolderName) ? "" : _remoteFolderName;
            var allObjects = await _client.ListBlobsAsync(prefix, string.Empty, false);

            return(allObjects.List.Select(x => x.Name).ToList());
        }
Example #2
0
        private static async Task <List <string> > ListAllFilesInFolders(IRavenAzureClient client, IEnumerable <RavenStorageClient.BlobProperties> folders)
        {
            var files = new List <string>();

            foreach (var folder in folders)
            {
                var objectsInFolder = await client.ListBlobsAsync(prefix : folder.Name, delimiter : string.Empty, listFolders : false);

                files.AddRange(objectsInFolder.List.Select(b => b.Name));
            }

            return(files);
        }
        protected override async Task <List <FileInfoDetails> > GetFiles(string path)
        {
            var allObjects = await _client.ListBlobsAsync(path, delimiter : string.Empty, listFolders : false);

            var filesInfo = new List <FileInfoDetails>();

            foreach (var obj in allObjects.List)
            {
                if (TryExtractDateFromFileName(obj.Name, out var lastModified) == false)
                {
                    continue;
                }

                var fullPath      = obj.Name;
                var directoryPath = GetDirectoryName(fullPath);
                filesInfo.Add(new FileInfoDetails(fullPath, directoryPath, lastModified));
            }

            return(filesInfo);
        }