/** * Returns a result segment of an enumerable collection of shares for this File service client. * * @return A {@link ResultSegment} object that contains a segment of the enumerable collection of * {@link CloudFileShare} objects that represent the shares for this client. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public ResultSegment<CloudFileShare> listSharesSegmented() throws StorageException { return this.listSharesSegmented(null, EnumSet.noneOf(ShareListingDetails.class), null, null /* continuationToken */, null /* options */, null /* opContext */); }
/** * Returns a result segment of an enumerable collection of shares for this File service client. * * @return A {@link ResultSegment} object that contains a segment of the enumerable collection of * {@link CloudFileShare} objects that represent the shares for this client. * * @throws StorageException * If a storage service error occurred. */ @DoesServiceRequest public ResultSegment<CloudFileShare> listSharesSegmented() throws StorageException { return this.listSharesSegmented(null, EnumSet.noneOf(ShareListingDetails.class), null, null /* continuationToken */, null /* options */, null /* opContext */); }
/** * Tests doing a listShares to ensure maxResults validation is working. * * @throws StorageException * @throws URISyntaxException */ @Test @Category({ DevFabricTests.class, DevStoreTests.class, CloudTests.class }) public void testListSharesMaxResultsValidationTest() throws StorageException, URISyntaxException { CloudFileClient fileClient = FileTestHelper.createCloudFileClient(); String prefix = UUID.randomUUID().toString(); // Validation should cause each of these to fail for (int i = 0; i >= -2; i--) { try{ fileClient.listSharesSegmented( prefix, EnumSet.allOf(ShareListingDetails.class), i, null, null, null); fail(); } catch (IllegalArgumentException e) { assertTrue(String.format(SR.PARAMETER_SHOULD_BE_GREATER_OR_EQUAL, "maxResults", 1) .equals(e.getMessage())); } } assertNotNull(fileClient.listSharesSegmented("thereshouldntbeanyshareswiththisprefix")); }
ResultSegment<CloudFileShare> segment = fileClient.listSharesSegmented(prefix, EnumSet.allOf(ShareListingDetails.class), 15, token, null, null);