private IList <Partition> GetPartitionsForAllPages()
        {
            var partitions = new List <Partition>();

            var result = _storageProvider.Search("Pages", string.Empty);
            var files  = result.Items.Select(x => x.RelativeUrl).ToArray();

            partitions.Add(new Partition(OperationType.Index, files));
            return(partitions);
        }
        protected virtual ICollection <BlobInfo> ReadBlobFolder(string folderPath, ICancellationToken token)
        {
            token?.ThrowIfCancellationRequested();

            var result = new List <BlobInfo>();

            var searchResults = _storageProvider.Search(folderPath, null);

            result.AddRange(searchResults.Items);
            foreach (var blobFolder in searchResults.Folders)
            {
                var folderResult = ReadBlobFolder(blobFolder.RelativeUrl, token);
                result.AddRange(folderResult);
            }

            return(result);
        }
Beispiel #3
0
        protected virtual ICollection <BlobInfo> ReadBlobFolder(string folderPath, ICancellationToken token)
        {
            token?.ThrowIfCancellationRequested();

            var result = new List <BlobInfo>();

            var searchResults = _storageProvider.Search(folderPath, null);

            searchResults.Items = searchResults.Items.Where(item => _imageExtensions.Contains(Path.GetExtension(item.FileName))).ToList();

            result.AddRange(searchResults.Items);
            foreach (var blobFolder in searchResults.Folders)
            {
                var folderResult = ReadBlobFolder(blobFolder.RelativeUrl, token);
                result.AddRange(folderResult);
            }

            return(result);
        }
Beispiel #4
0
        public IHttpActionResult SearchAssetItems(string folderUrl = null, string keyword = null)
        {
            var result = _blobProvider.Search(folderUrl, keyword);

            return(Ok(result.ToWebModel()));
        }