Class ShareServiceAsyncClient
Instantiating an Asynchronous File Service Client
ShareAsyncClient client = new ShareClientBuilder() .connectionString("${connectionString}") .endpoint("${endpoint}") .buildAsyncClient();
View this
for additional ways to construct the azureFileStorageClient.
-
Method Summary
Modifier and TypeMethodDescriptioncreateShare
(String shareName) Creates a share in the storage account with the specified name and returns a ShareAsyncClient to interact with it.Mono<com.azure.core.http.rest.Response<ShareAsyncClient>>
createShareWithResponse
(String shareName, ShareCreateOptions options) Creates a share in the storage account with the specified name, and options and returns a ShareAsyncClient to interact with it.Mono<com.azure.core.http.rest.Response<ShareAsyncClient>>
Creates a share in the storage account with the specified name, metadata, and quota and returns a ShareAsyncClient to interact with it.deleteShare
(String shareName) Deletes the share in the storage account with the given name.deleteShareWithResponse
(String shareName, String snapshot) Deletes the specific snapshot of the share in the storage account with the given name.generateAccountSas
(AccountSasSignatureValues accountSasSignatureValues) Generates an account SAS for the Azure Storage account using the specifiedAccountSasSignatureValues
.generateAccountSas
(AccountSasSignatureValues accountSasSignatureValues, com.azure.core.util.Context context) Generates an account SAS for the Azure Storage account using the specifiedAccountSasSignatureValues
.Get associated account name.Get the url of the storage file service client.com.azure.core.http.HttpPipeline
Gets theHttpPipeline
powering this client.Retrieves the properties of the storage account's File service.Mono<com.azure.core.http.rest.Response<ShareServiceProperties>>
Retrieves the properties of the storage account's File service.Gets the service version the client is using.getShareAsyncClient
(String shareName) Constructs a ShareAsyncClient that interacts with the specified share.getShareAsyncClient
(String shareName, String snapshot) Constructs a ShareAsyncClient that interacts with the specified share.com.azure.core.http.rest.PagedFlux<ShareItem>
Lists all shares in the storage account without their metadata or snapshots.com.azure.core.http.rest.PagedFlux<ShareItem>
listShares
(ListSharesOptions options) Lists the shares in the Storage account that pass the options filter.setProperties
(ShareServiceProperties properties) Sets the properties for the storage account's File service.setPropertiesWithResponse
(ShareServiceProperties properties) Sets the properties for the storage account's File service.undeleteShare
(String deletedShareName, String deletedShareVersion) Restores a previously deleted share.Mono<com.azure.core.http.rest.Response<ShareAsyncClient>>
undeleteShareWithResponse
(String deletedShareName, String deletedShareVersion) Restores a previously deleted share.
-
Method Details
-
getFileServiceUrl
Get the url of the storage file service client.- Returns:
- the url of the Storage File service.
-
getServiceVersion
Gets the service version the client is using.- Returns:
- the service version the client is using.
-
getProperties
Retrieves the properties of the storage account's File service. The properties range from storage analytics and metrics to CORS (Cross-Origin Resource Sharing).Code Samples
Retrieve File service properties
fileServiceAsyncClient.getProperties() .subscribe(properties -> { System.out.printf("Hour metrics enabled: %b, Minute metrics enabled: %b", properties.getHourMetrics().isEnabled(), properties.getMinuteMetrics().isEnabled()); });
For more information, see the Azure Docs.
- Returns:
- Storage account
File service properties
-
getPropertiesWithResponse
Retrieves the properties of the storage account's File service. The properties range from storage analytics and metrics to CORS (Cross-Origin Resource Sharing).Code Samples
Retrieve File service properties
fileServiceAsyncClient.getPropertiesWithResponse() .subscribe(properties -> System.out.printf("Hour metrics enabled: %b, Minute metrics enabled: %b", properties.getValue().getHourMetrics().isEnabled(), properties.getValue().getMinuteMetrics().isEnabled()));
For more information, see the Azure Docs.
- Returns:
- A response containing the Storage account
File service properties
-
getAccountName
Get associated account name.- Returns:
- account name associated with this storage resource.
-
getHttpPipeline
public com.azure.core.http.HttpPipeline getHttpPipeline()Gets theHttpPipeline
powering this client.- Returns:
- The pipeline.
-
generateAccountSas
Generates an account SAS for the Azure Storage account using the specifiedAccountSasSignatureValues
.Note : The client must be authenticated via
StorageSharedKeyCredential
See
AccountSasSignatureValues
for more information on how to construct an account SAS.The snippet below generates a SAS that lasts for two days and gives the user read and list access to blob containers and file shares.
AccountSasPermission permissions = new AccountSasPermission() .setListPermission(true) .setReadPermission(true); AccountSasResourceType resourceTypes = new AccountSasResourceType().setContainer(true); AccountSasService services = new AccountSasService().setBlobAccess(true).setFileAccess(true); OffsetDateTime expiryTime = OffsetDateTime.now().plus(Duration.ofDays(2)); AccountSasSignatureValues sasValues = new AccountSasSignatureValues(expiryTime, permissions, services, resourceTypes); // Client must be authenticated via StorageSharedKeyCredential String sas = fileServiceAsyncClient.generateAccountSas(sasValues);
- Parameters:
accountSasSignatureValues
-AccountSasSignatureValues
- Returns:
- A
String
representing the SAS query parameters.
-
generateAccountSas
public String generateAccountSas(AccountSasSignatureValues accountSasSignatureValues, com.azure.core.util.Context context) Generates an account SAS for the Azure Storage account using the specifiedAccountSasSignatureValues
.Note : The client must be authenticated via
StorageSharedKeyCredential
See
AccountSasSignatureValues
for more information on how to construct an account SAS.The snippet below generates a SAS that lasts for two days and gives the user read and list access to blob containers and file shares.
AccountSasPermission permissions = new AccountSasPermission() .setListPermission(true) .setReadPermission(true); AccountSasResourceType resourceTypes = new AccountSasResourceType().setContainer(true); AccountSasService services = new AccountSasService().setBlobAccess(true).setFileAccess(true); OffsetDateTime expiryTime = OffsetDateTime.now().plus(Duration.ofDays(2)); AccountSasSignatureValues sasValues = new AccountSasSignatureValues(expiryTime, permissions, services, resourceTypes); // Client must be authenticated via StorageSharedKeyCredential String sas = fileServiceAsyncClient.generateAccountSas(sasValues, new Context("key", "value"));
- Parameters:
accountSasSignatureValues
-AccountSasSignatureValues
context
- Additional context that is passed through the code when generating a SAS.- Returns:
- A
String
representing the SAS query parameters.
-