/** * Returns a result segment of an enumerable collection of containers for the service client associated with this * container. * * @return A {@link ResultSegment} object that contains a segment of the enumerable collection of * {@link CloudBlobContainer} objects that represent the containers for the service client associated with * this container. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public ResultSegment<CloudBlobContainer> listContainersSegmented() throws StorageException { return this.blobServiceClient.listContainersSegmented(); }
/** * Returns a result segment of an enumerable collection of containers for the service client associated with this * container. * * @return A {@link ResultSegment} object that contains a segment of the enumerable collection of * {@link CloudBlobContainer} objects that represent the containers for the service client associated with * this container. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public ResultSegment<CloudBlobContainer> listContainersSegmented() throws StorageException { return this.blobServiceClient.listContainersSegmented(); }
/** * Returns a result segment of an enumerable collection of blob containers for this Blob service client. * * @return A {@link ResultSegment} object that contains a segment of the enumerable collection of * {@link CloudBlobContainer} objects that represent the containers for this client. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public ResultSegment<CloudBlobContainer> listContainersSegmented() throws StorageException { return this.listContainersSegmented(null, ContainerListingDetails.NONE, null, null /* continuationToken */, null /* options */, null /* opContext */); }
/** * Returns a result segment of an enumerable collection of blob containers for this Blob service client. * * @return A {@link ResultSegment} object that contains a segment of the enumerable collection of * {@link CloudBlobContainer} objects that represent the containers for this client. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public ResultSegment<CloudBlobContainer> listContainersSegmented() throws StorageException { return this.listContainersSegmented(null, ContainerListingDetails.NONE, null, null /* continuationToken */, null /* options */, null /* opContext */); }
/** * Returns a result segment of an enumerable collection of containers whose names begin with the specified prefix * for the service client associated with this container. * * @param prefix * A <code>String</code> that represents the blob name prefix. * * @return A {@link ResultSegment} object that contains a segment of the enumerable collection of * {@link CloudBlobContainer} objects that represent the containers whose names begin with the specified * prefix for the service client associated with this container. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public ResultSegment<CloudBlobContainer> listContainersSegmented(final String prefix) throws StorageException { return this.blobServiceClient.listContainersSegmented(prefix); }
/** * Returns a result segment of an enumerable collection of containers whose names begin with the specified prefix * for the service client associated with this container. * * @param prefix * A <code>String</code> that represents the blob name prefix. * * @return A {@link ResultSegment} object that contains a segment of the enumerable collection of * {@link CloudBlobContainer} objects that represent the containers whose names begin with the specified * prefix for the service client associated with this container. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public ResultSegment<CloudBlobContainer> listContainersSegmented(final String prefix) throws StorageException { return this.blobServiceClient.listContainersSegmented(prefix); }
final ResultContinuation continuationToken, final BlobRequestOptions options, final OperationContext opContext) throws StorageException { return this.blobServiceClient.listContainersSegmented(prefix, detailsIncluded, maxResults, continuationToken, options, opContext);
final ResultContinuation continuationToken, final BlobRequestOptions options, final OperationContext opContext) throws StorageException { return this.blobServiceClient.listContainersSegmented(prefix, detailsIncluded, maxResults, continuationToken, options, opContext);
/** * Try to list the containers to ensure maxResults validation is working. * * @throws StorageException * @throws URISyntaxException */ @Test @Category({ DevFabricTests.class, DevStoreTests.class, CloudTests.class }) public void testListContainersMaxResultsValidation() throws StorageException, URISyntaxException { CloudBlobClient bClient = BlobTestHelper.createCloudBlobClient(); String prefix = UUID.randomUUID().toString(); // Validation should cause each of these to fail. for(int i = 0; i >= -2; i--) { try { bClient.listContainersSegmented( prefix, ContainerListingDetails.ALL, i, null, null, null); fail(); } catch (IllegalArgumentException e) { assertTrue(String.format(SR.PARAMETER_SHOULD_BE_GREATER_OR_EQUAL, "maxResults", 1) .equals(e.getMessage())); } } assertNotNull(bClient.listContainersSegmented("thereshouldntbeanycontainersswiththisprefix")); }
/** * Fetch result segments and ensure pageSize is null when unspecified and will cap at 5000. * * @throws StorageException * @throws URISyntaxException */ @Test @Category({ DevFabricTests.class, DevStoreTests.class, CloudTests.class }) public void testListContainersResultSegment() throws StorageException, URISyntaxException { CloudBlobClient bClient = BlobTestHelper.createCloudBlobClient(); ResultSegment<CloudBlobContainer> segment1 = bClient.listContainersSegmented(); assertNotNull(segment1); assertNull(segment1.getPageSize()); ResultSegment<CloudBlobContainer> segment2 = bClient.listContainersSegmented(null, ContainerListingDetails.ALL, 9001, null, null, null); assertNotNull(segment2); assertNotNull(segment2.getPageSize()); assertEquals(5000, segment2.getPageSize().intValue()); }
do { ResultSegment<CloudBlobContainer> segment = bClient.listContainersSegmented(prefix, ContainerListingDetails.ALL, 15, token, null, null);
@Override public AttributedList<Path> list(final Path directory, final ListProgressListener listener) throws BackgroundException { ResultSegment<CloudBlobContainer> result; ResultContinuation token = null; try { final AttributedList<Path> containers = new AttributedList<Path>(); do { final BlobRequestOptions options = new BlobRequestOptions(); result = session.getClient().listContainersSegmented(null, ContainerListingDetails.NONE, preferences.getInteger("azure.listing.chunksize"), token, options, context); for(CloudBlobContainer container : result.getResults()) { final PathAttributes attributes = new PathAttributes(); attributes.setETag(container.getProperties().getEtag()); attributes.setModificationDate(container.getProperties().getLastModified().getTime()); containers.add(new Path(PathNormalizer.normalize(container.getName()), EnumSet.of(Path.Type.volume, Path.Type.directory), attributes)); } listener.chunk(directory, containers); token = result.getContinuationToken(); } while(result.getHasMoreResults()); return containers; } catch(StorageException e) { throw new AzureExceptionMappingService().map("Listing directory {0} failed", e, directory); } }