Search in sources :

Example 1 with BlobFlatListSegment

use of com.microsoft.azure.storage.blob.models.BlobFlatListSegment in project geowebcache by GeoWebCache.

the class AzureClient method listBlobs.

public List<BlobItem> listBlobs(String prefix, Integer maxResults) {
    ContainerListBlobFlatSegmentResponse response = container.listBlobsFlatSegment(null, new ListBlobsOptions().withPrefix(prefix).withMaxResults(maxResults)).blockingGet();
    BlobFlatListSegment segment = response.body().segment();
    List<BlobItem> items = new ArrayList<>();
    if (segment != null) {
        items.addAll(segment.blobItems());
    }
    return items;
}
Also used : BlobItem(com.microsoft.azure.storage.blob.models.BlobItem) ListBlobsOptions(com.microsoft.azure.storage.blob.ListBlobsOptions) ArrayList(java.util.ArrayList) ContainerListBlobFlatSegmentResponse(com.microsoft.azure.storage.blob.models.ContainerListBlobFlatSegmentResponse) BlobFlatListSegment(com.microsoft.azure.storage.blob.models.BlobFlatListSegment)

Aggregations

ListBlobsOptions (com.microsoft.azure.storage.blob.ListBlobsOptions)1 BlobFlatListSegment (com.microsoft.azure.storage.blob.models.BlobFlatListSegment)1 BlobItem (com.microsoft.azure.storage.blob.models.BlobItem)1 ContainerListBlobFlatSegmentResponse (com.microsoft.azure.storage.blob.models.ContainerListBlobFlatSegmentResponse)1 ArrayList (java.util.ArrayList)1