BlobContainerClient.listBlobs Method

Definition

Overloads

listBlobs()

Returns a lazy loaded list of blobs in this container, with folder structures flattened. The returned PagedIterable<T> can be consumed through while new items are automatically retrieved as needed.

Blob names are returned in lexicographic order.

For more information, see the Azure Docs.

Code Samples

client.listBlobs().forEach(blob ->
     System.out.printf("Name: %s, Directory? %b%n", blob.getName(), blob.isPrefix()));
listBlobs(ListBlobsOptions options, String continuationToken, Duration timeout)

Returns a lazy loaded list of blobs in this container, with folder structures flattened. The returned PagedIterable<T> can be consumed through while new items are automatically retrieved as needed.

Blob names are returned in lexicographic order.

For more information, see the Azure Docs.

Code Samples

ListBlobsOptions options = new ListBlobsOptions()
     .setPrefix("prefixToMatch")
     .setDetails(new BlobListDetails()
         .setRetrieveDeletedBlobs(true)
         .setRetrieveSnapshots(true));
 
 String continuationToken = "continuationToken";
 
 client.listBlobs(options, continuationToken, timeout).forEach(blob ->
     System.out.printf("Name: %s, Directory? %b, Deleted? %b, Snapshot ID: %s%n",
         blob.getName(),
         blob.isPrefix(),
         blob.isDeleted(),
         blob.getSnapshot()));
listBlobs(ListBlobsOptions options, Duration timeout)

Returns a lazy loaded list of blobs in this container, with folder structures flattened. The returned PagedIterable<T> can be consumed through while new items are automatically retrieved as needed.

Blob names are returned in lexicographic order.

For more information, see the Azure Docs.

Code Samples

ListBlobsOptions options = new ListBlobsOptions()
     .setPrefix("prefixToMatch")
     .setDetails(new BlobListDetails()
         .setRetrieveDeletedBlobs(true)
         .setRetrieveSnapshots(true));
 
 client.listBlobs(options, timeout).forEach(blob ->
     System.out.printf("Name: %s, Directory? %b, Deleted? %b, Snapshot ID: %s%n",
         blob.getName(),
         blob.isPrefix(),
         blob.isDeleted(),
         blob.getSnapshot()));

listBlobs()

Returns a lazy loaded list of blobs in this container, with folder structures flattened. The returned PagedIterable<T> can be consumed through while new items are automatically retrieved as needed.

Blob names are returned in lexicographic order.

For more information, see the Azure Docs.

Code Samples

client.listBlobs().forEach(blob ->
     System.out.printf("Name: %s, Directory? %b%n", blob.getName(), blob.isPrefix()));
public PagedIterable<BlobItem> listBlobs()

Returns

The listed blobs, flattened.

listBlobs(ListBlobsOptions options, String continuationToken, Duration timeout)

Returns a lazy loaded list of blobs in this container, with folder structures flattened. The returned PagedIterable<T> can be consumed through while new items are automatically retrieved as needed.

Blob names are returned in lexicographic order.

For more information, see the Azure Docs.

Code Samples

ListBlobsOptions options = new ListBlobsOptions()
     .setPrefix("prefixToMatch")
     .setDetails(new BlobListDetails()
         .setRetrieveDeletedBlobs(true)
         .setRetrieveSnapshots(true));
 
 String continuationToken = "continuationToken";
 
 client.listBlobs(options, continuationToken, timeout).forEach(blob ->
     System.out.printf("Name: %s, Directory? %b, Deleted? %b, Snapshot ID: %s%n",
         blob.getName(),
         blob.isPrefix(),
         blob.isDeleted(),
         blob.getSnapshot()));
public PagedIterable<BlobItem> listBlobs(ListBlobsOptions options, String continuationToken, Duration timeout)

Parameters

options
ListBlobsOptions

ListBlobsOptions. If iterating by page, the page size passed to byPage methods such as PagedIterable#iterableByPage(int) will be preferred over the value set on these options.

continuationToken
java.lang.String

Identifies the portion of the list to be returned with the next list operation.

timeout
java.time.Duration

An optional timeout value beyond which a RuntimeException will be raised.

Returns

The listed blobs, flattened.

listBlobs(ListBlobsOptions options, Duration timeout)

Returns a lazy loaded list of blobs in this container, with folder structures flattened. The returned PagedIterable<T> can be consumed through while new items are automatically retrieved as needed.

Blob names are returned in lexicographic order.

For more information, see the Azure Docs.

Code Samples

ListBlobsOptions options = new ListBlobsOptions()
     .setPrefix("prefixToMatch")
     .setDetails(new BlobListDetails()
         .setRetrieveDeletedBlobs(true)
         .setRetrieveSnapshots(true));
 
 client.listBlobs(options, timeout).forEach(blob ->
     System.out.printf("Name: %s, Directory? %b, Deleted? %b, Snapshot ID: %s%n",
         blob.getName(),
         blob.isPrefix(),
         blob.isDeleted(),
         blob.getSnapshot()));
public PagedIterable<BlobItem> listBlobs(ListBlobsOptions options, Duration timeout)

Parameters

options
ListBlobsOptions

ListBlobsOptions. If iterating by page, the page size passed to byPage methods such as PagedIterable#iterableByPage(int) will be preferred over the value set on these options.

timeout
java.time.Duration

An optional timeout value beyond which a RuntimeException will be raised.

Returns

The listed blobs, flattened.

Applies to