예제 #1
0
        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());
        }
예제 #2
0
파일: AzureTests.cs 프로젝트: ikvm/ravendb
        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);
        }
예제 #3
0
        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);
        }