Class DataLakePathAsyncClient
- java.lang.Object
-
- com.azure.storage.file.datalake.DataLakePathAsyncClient
-
- Direct Known Subclasses:
DataLakeDirectoryAsyncClient,DataLakeFileAsyncClient
public class DataLakePathAsyncClient extends Object
This class provides a client that contains all operations that apply to any path object.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Mono<PathInfo>create()Creates a resource.Mono<PathInfo>create(boolean overwrite)Creates a resource.Mono<PathInfo>createIfNotExists()Creates a resource if it does not exist.Mono<com.azure.core.http.rest.Response<PathInfo>>createIfNotExistsWithResponse(DataLakePathCreateOptions options)Creates a resource if it does not exist.Mono<com.azure.core.http.rest.Response<PathInfo>>createWithResponse(String permissions, String umask, PathHttpHeaders headers, Map<String,String> metadata, DataLakeRequestConditions requestConditions)Creates a resource.Mono<Boolean>deleteIfExists()Deletes paths under the resource if it exists.Mono<com.azure.core.http.rest.Response<Boolean>>deleteIfExistsWithResponse(DataLakePathDeleteOptions options)Deletes all paths under the specified resource if exists.Mono<Boolean>exists()Determines if the path this client represents exists in the cloud.Mono<com.azure.core.http.rest.Response<Boolean>>existsWithResponse()Determines if the path this client represents exists in the cloud.StringgenerateSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues)Generates a service SAS for the path using the specifiedDataLakeServiceSasSignatureValuesStringgenerateSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues, com.azure.core.util.Context context)Generates a service SAS for the path using the specifiedDataLakeServiceSasSignatureValuesStringgenerateUserDelegationSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues, UserDelegationKey userDelegationKey)Generates a user delegation SAS for the path using the specifiedDataLakeServiceSasSignatureValues.StringgenerateUserDelegationSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues, UserDelegationKey userDelegationKey, String accountName, com.azure.core.util.Context context)Generates a user delegation SAS for the path using the specifiedDataLakeServiceSasSignatureValues.Mono<PathAccessControl>getAccessControl()Returns the access control for a resource.Mono<com.azure.core.http.rest.Response<PathAccessControl>>getAccessControlWithResponse(boolean userPrincipalNameReturned, DataLakeRequestConditions requestConditions)Returns the access control for a resource.StringgetAccountName()Gets the associated account name.CustomerProvidedKeygetCustomerProvidedKey()Gets theCpkInfoused to encrypt this path's content on the server.DataLakePathAsyncClientgetCustomerProvidedKeyAsyncClient(CustomerProvidedKey customerProvidedKey)Creates a newDataLakePathAsyncClientwith the specifiedcustomerProvidedKey.StringgetFileSystemName()Gets the name of the File System in which this object lives.com.azure.core.http.HttpPipelinegetHttpPipeline()Gets theHttpPipelinepowering this client.Mono<PathProperties>getProperties()Returns the resource's metadata and properties.Mono<com.azure.core.http.rest.Response<PathProperties>>getPropertiesWithResponse(DataLakeRequestConditions requestConditions)Returns the resource's metadata and properties.DataLakeServiceVersiongetServiceVersion()Gets the service version the client is using.Mono<AccessControlChangeResult>removeAccessControlRecursive(List<PathRemoveAccessControlEntry> accessControlList)Recursively removes the access control on a path and all subpaths.Mono<com.azure.core.http.rest.Response<AccessControlChangeResult>>removeAccessControlRecursiveWithResponse(PathRemoveAccessControlRecursiveOptions options)Recursively removes the access control on a path and all subpaths.Mono<PathInfo>setAccessControlList(List<PathAccessControlEntry> accessControlList, String group, String owner)Changes the access control list, group and/or owner for a resource.Mono<com.azure.core.http.rest.Response<PathInfo>>setAccessControlListWithResponse(List<PathAccessControlEntry> accessControlList, String group, String owner, DataLakeRequestConditions requestConditions)Changes the access control list, group and/or owner for a resource.Mono<AccessControlChangeResult>setAccessControlRecursive(List<PathAccessControlEntry> accessControlList)Recursively sets the access control on a path and all subpaths.Mono<com.azure.core.http.rest.Response<AccessControlChangeResult>>setAccessControlRecursiveWithResponse(PathSetAccessControlRecursiveOptions options)Recursively sets the access control on a path and all subpaths.Mono<Void>setHttpHeaders(PathHttpHeaders headers)Changes a resource's HTTP header properties.Mono<com.azure.core.http.rest.Response<Void>>setHttpHeadersWithResponse(PathHttpHeaders headers, DataLakeRequestConditions requestConditions)Changes a resource's HTTP header properties.Mono<Void>setMetadata(Map<String,String> metadata)Changes a resource's metadata.Mono<com.azure.core.http.rest.Response<Void>>setMetadataWithResponse(Map<String,String> metadata, DataLakeRequestConditions requestConditions)Changes a resource's metadata.Mono<PathInfo>setPermissions(PathPermissions permissions, String group, String owner)Changes the permissions, group and/or owner for a resource.Mono<com.azure.core.http.rest.Response<PathInfo>>setPermissionsWithResponse(PathPermissions permissions, String group, String owner, DataLakeRequestConditions requestConditions)Changes the permissions, group and/or owner for a resource.Mono<AccessControlChangeResult>updateAccessControlRecursive(List<PathAccessControlEntry> accessControlList)Recursively updates the access control on a path and all subpaths.Mono<com.azure.core.http.rest.Response<AccessControlChangeResult>>updateAccessControlRecursiveWithResponse(PathUpdateAccessControlRecursiveOptions options)Recursively updates the access control on a path and all subpaths.
-
-
-
Method Detail
-
getAccountName
public String getAccountName()
Gets the associated account name.- Returns:
- Account name associated with this storage resource.
-
getFileSystemName
public String getFileSystemName()
Gets the name of the File System in which this object lives.- Returns:
- The name of the File System.
-
getHttpPipeline
public com.azure.core.http.HttpPipeline getHttpPipeline()
Gets theHttpPipelinepowering this client.- Returns:
- The pipeline.
-
getServiceVersion
public DataLakeServiceVersion getServiceVersion()
Gets the service version the client is using.- Returns:
- the service version the client is using.
-
getCustomerProvidedKey
public CustomerProvidedKey getCustomerProvidedKey()
Gets theCpkInfoused to encrypt this path's content on the server.- Returns:
- the customer provided key used for encryption.
-
getCustomerProvidedKeyAsyncClient
public DataLakePathAsyncClient getCustomerProvidedKeyAsyncClient(CustomerProvidedKey customerProvidedKey)
Creates a newDataLakePathAsyncClientwith the specifiedcustomerProvidedKey.- Parameters:
customerProvidedKey- theCustomerProvidedKeyfor the path, passnullto use no customer provided key.- Returns:
- a
DataLakePathAsyncClientwith the specifiedcustomerProvidedKey.
-
create
public Mono<PathInfo> create()
Creates a resource. By default, this method will not overwrite an existing path.Code Samples
client.create().subscribe(response -> System.out.printf("Last Modified Time:%s", response.getLastModified()));For more information see the Azure Docs
- Returns:
- A reactive response containing information about the created resource.
-
create
public Mono<PathInfo> create(boolean overwrite)
Creates a resource.Code Samples
boolean overwrite = true; client.create(overwrite).subscribe(response -> System.out.printf("Last Modified Time:%s", response.getLastModified()));For more information see the Azure Docs
- Parameters:
overwrite- Whether to overwrite, should data exist on the file.- Returns:
- A reactive response containing information about the created resource.
-
createWithResponse
public Mono<com.azure.core.http.rest.Response<PathInfo>> createWithResponse(String permissions, String umask, PathHttpHeaders headers, Map<String,String> metadata, DataLakeRequestConditions requestConditions)
Creates a resource.Code Samples
PathHttpHeaders httpHeaders = new PathHttpHeaders() .setContentLanguage("en-US") .setContentType("binary"); DataLakeRequestConditions requestConditions = new DataLakeRequestConditions() .setLeaseId(leaseId); String permissions = "permissions"; String umask = "umask"; client.createWithResponse(permissions, umask, httpHeaders, Collections.singletonMap("metadata", "value"), requestConditions) .subscribe(response -> System.out.printf("Last Modified Time:%s", response.getValue().getLastModified()));For more information see the Azure Docs
- Parameters:
permissions- POSIX access permissions for the resource owner, the resource owning group, and others.umask- Restricts permissions of the resource to be created.headers-PathHttpHeadersmetadata- Metadata to associate with the resource. If there is leading or trailing whitespace in any metadata key or value, it must be removed or encoded.requestConditions-DataLakeRequestConditions- Returns:
- A
Monocontaining aResponsewhosevaluecontains aPathItem.
-
createIfNotExists
public Mono<PathInfo> createIfNotExists()
Creates a resource if it does not exist.Code Samples
client.createIfNotExists().subscribe(response -> System.out.printf("Created at %s%n", response.getLastModified()));For more information see the Azure Docs
- Returns:
- A reactive response signaling completion.
PathInfocontains information about the created resource.
-
createIfNotExistsWithResponse
public Mono<com.azure.core.http.rest.Response<PathInfo>> createIfNotExistsWithResponse(DataLakePathCreateOptions options)
Creates a resource if it does not exist.Code Samples
PathHttpHeaders headers = new PathHttpHeaders() .setContentLanguage("en-US") .setContentType("binary"); String permissions = "permissions"; String umask = "umask"; Map<String, String> metadata = Collections.singletonMap("metadata", "value"); DataLakePathCreateOptions options = new DataLakePathCreateOptions().setPathHttpHeaders(headers) .setPermissions(permissions).setUmask(umask).setMetadata(metadata); client.createIfNotExistsWithResponse(options).subscribe(response -> { if (response.getStatusCode() == 409) { System.out.println("Already exists."); } else { System.out.println("successfully created."); } });For more information see the Azure Docs
- Parameters:
options-DataLakePathCreateOptions- Returns:
- A
MonocontainingResponsesignaling completion, whosevaluecontains aPathInfocontaining information about the resource. IfResponse's status code is 201, a new resource was successfully created. If status code is 409, a resource already existed at this location.
-
deleteIfExists
public Mono<Boolean> deleteIfExists()
Deletes paths under the resource if it exists.Code Samples
client.deleteIfExists().subscribe( response -> System.out.printf("Delete completed%n"), error -> System.out.printf("Delete failed: %s%n", error));For more information see the Azure Docs
- Returns:
- a reactive response signaling completion.
trueindicates that the resource under the path was successfully deleted,falseindicates the resource did not exist.
-
deleteIfExistsWithResponse
public Mono<com.azure.core.http.rest.Response<Boolean>> deleteIfExistsWithResponse(DataLakePathDeleteOptions options)
Deletes all paths under the specified resource if exists.Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions() .setLeaseId(leaseId); DataLakePathDeleteOptions options = new DataLakePathDeleteOptions().setIsRecursive(false) .setRequestConditions(requestConditions); client.deleteIfExistsWithResponse(options).subscribe(response -> { if (response.getStatusCode() == 404) { System.out.println("Does not exist."); } else { System.out.println("successfully deleted."); } });For more information see the Azure Docs
- Parameters:
options-DataLakePathDeleteOptions- Returns:
- A reactive response signaling completion. If
Response's status code is 200, the resource was successfully deleted. If status code is 404, the resource does not exist.
-
setMetadata
public Mono<Void> setMetadata(Map<String,String> metadata)
Changes a resource's metadata. The specified metadata in this method will replace existing metadata. If old values must be preserved, they must be downloaded and included in the call to this method.Code Samples
client.setMetadata(Collections.singletonMap("metadata", "value")) .subscribe(response -> System.out.println("Set metadata completed"));For more information, see the Azure Docs
- Parameters:
metadata- Metadata to associate with the resource. If there is leading or trailing whitespace in any metadata key or value, it must be removed or encoded.- Returns:
- A reactive response signalling completion.
-
setMetadataWithResponse
public Mono<com.azure.core.http.rest.Response<Void>> setMetadataWithResponse(Map<String,String> metadata, DataLakeRequestConditions requestConditions)
Changes a resource's metadata. The specified metadata in this method will replace existing metadata. If old values must be preserved, they must be downloaded and included in the call to this method.Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions().setLeaseId(leaseId); client.setMetadataWithResponse(Collections.singletonMap("metadata", "value"), requestConditions) .subscribe(response -> System.out.printf("Set metadata completed with status %d%n", response.getStatusCode()));For more information, see the Azure Docs
- Parameters:
metadata- Metadata to associate with the resource. If there is leading or trailing whitespace in any metadata key or value, it must be removed or encoded.requestConditions-DataLakeRequestConditions- Returns:
- A reactive response signalling completion.
-
setHttpHeaders
public Mono<Void> setHttpHeaders(PathHttpHeaders headers)
Changes a resource's HTTP header properties. If only one HTTP header is updated, the others will all be erased. In order to preserve existing values, they must be passed alongside the header being changed.Code Samples
client.setHttpHeaders(new PathHttpHeaders() .setContentLanguage("en-US") .setContentType("binary"));For more information, see the Azure Docs
- Parameters:
headers-PathHttpHeaders- Returns:
- A reactive response signalling completion.
-
setHttpHeadersWithResponse
public Mono<com.azure.core.http.rest.Response<Void>> setHttpHeadersWithResponse(PathHttpHeaders headers, DataLakeRequestConditions requestConditions)
Changes a resource's HTTP header properties. If only one HTTP header is updated, the others will all be erased. In order to preserve existing values, they must be passed alongside the header being changed.Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions().setLeaseId(leaseId); client.setHttpHeadersWithResponse(new PathHttpHeaders() .setContentLanguage("en-US") .setContentType("binary"), requestConditions).subscribe(response -> System.out.printf("Set HTTP headers completed with status %d%n", response.getStatusCode()));For more information, see the Azure Docs
- Parameters:
headers-PathHttpHeadersrequestConditions-DataLakeRequestConditions- Returns:
- A reactive response signalling completion.
-
getProperties
public Mono<PathProperties> getProperties()
Returns the resource's metadata and properties.Code Samples
client.getProperties().subscribe(response -> System.out.printf("Creation Time: %s, Size: %d%n", response.getCreationTime(), response.getFileSize()));For more information, see the Azure Docs
- Returns:
- A reactive response containing the resource's properties and metadata.
-
getPropertiesWithResponse
public Mono<com.azure.core.http.rest.Response<PathProperties>> getPropertiesWithResponse(DataLakeRequestConditions requestConditions)
Returns the resource's metadata and properties.Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions().setLeaseId(leaseId); client.getPropertiesWithResponse(requestConditions).subscribe( response -> System.out.printf("Creation Time: %s, Size: %d%n", response.getValue().getCreationTime(), response.getValue().getFileSize()));For more information, see the Azure Docs
- Parameters:
requestConditions-DataLakeRequestConditions- Returns:
- A reactive response containing the resource's properties and metadata.
-
exists
public Mono<Boolean> exists()
Determines if the path this client represents exists in the cloud.Note that this method does not guarantee that the path type (file/directory) matches expectations.
For example, a DataLakeFileClient representing a path to a datalake directory will return true, and vice versa.
Code Samples
client.exists().subscribe(response -> System.out.printf("Exists? %b%n", response));- Returns:
- true if the path exists, false if it doesn't
-
existsWithResponse
public Mono<com.azure.core.http.rest.Response<Boolean>> existsWithResponse()
Determines if the path this client represents exists in the cloud.Note that this method does not guarantee that the path type (file/directory) matches expectations.
For example, a DataLakeFileClient representing a path to a datalake directory will return true, and vice versa.
Code Samples
client.existsWithResponse().subscribe(response -> System.out.printf("Exists? %b%n", response.getValue()));- Returns:
- true if the path exists, false if it doesn't
-
setAccessControlList
public Mono<PathInfo> setAccessControlList(List<PathAccessControlEntry> accessControlList, String group, String owner)
Changes the access control list, group and/or owner for a resource.Code Samples
PathAccessControlEntry pathAccessControlEntry = new PathAccessControlEntry() .setEntityId("entityId") .setPermissions(new RolePermissions().setReadPermission(true)); List<PathAccessControlEntry> pathAccessControlEntries = new ArrayList<>(); pathAccessControlEntries.add(pathAccessControlEntry); String group = "group"; String owner = "owner"; client.setAccessControlList(pathAccessControlEntries, group, owner).subscribe( response -> System.out.printf("Last Modified Time: %s", response.getLastModified()));For more information, see the Azure Docs
- Parameters:
accessControlList- A list ofPathAccessControlEntryobjects.group- The group of the resource.owner- The owner of the resource.- Returns:
- A reactive response containing the resource info.
-
setAccessControlListWithResponse
public Mono<com.azure.core.http.rest.Response<PathInfo>> setAccessControlListWithResponse(List<PathAccessControlEntry> accessControlList, String group, String owner, DataLakeRequestConditions requestConditions)
Changes the access control list, group and/or owner for a resource.Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions().setLeaseId(leaseId); PathAccessControlEntry pathAccessControlEntry = new PathAccessControlEntry() .setEntityId("entityId") .setPermissions(new RolePermissions().setReadPermission(true)); List<PathAccessControlEntry> pathAccessControlEntries = new ArrayList<>(); pathAccessControlEntries.add(pathAccessControlEntry); String group = "group"; String owner = "owner"; client.setAccessControlListWithResponse(pathAccessControlEntries, group, owner, requestConditions).subscribe( response -> System.out.printf("Last Modified Time: %s", response.getValue().getLastModified()));For more information, see the Azure Docs
- Parameters:
accessControlList- A list ofPathAccessControlEntryobjects.group- The group of the resource.owner- The owner of the resource.requestConditions-DataLakeRequestConditions- Returns:
- A reactive response containing the resource info.
-
setPermissions
public Mono<PathInfo> setPermissions(PathPermissions permissions, String group, String owner)
Changes the permissions, group and/or owner for a resource.Code Samples
PathPermissions permissions = new PathPermissions() .setGroup(new RolePermissions().setExecutePermission(true).setReadPermission(true)) .setOwner(new RolePermissions().setExecutePermission(true).setReadPermission(true).setWritePermission(true)) .setOther(new RolePermissions().setReadPermission(true)); String group = "group"; String owner = "owner"; client.setPermissions(permissions, group, owner).subscribe( response -> System.out.printf("Last Modified Time: %s", response.getLastModified()));For more information, see the Azure Docs
- Parameters:
permissions-PathPermissionsgroup- The group of the resource.owner- The owner of the resource.- Returns:
- A reactive response containing the resource info.
-
setPermissionsWithResponse
public Mono<com.azure.core.http.rest.Response<PathInfo>> setPermissionsWithResponse(PathPermissions permissions, String group, String owner, DataLakeRequestConditions requestConditions)
Changes the permissions, group and/or owner for a resource.Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions().setLeaseId(leaseId); PathPermissions permissions = new PathPermissions() .setGroup(new RolePermissions().setExecutePermission(true).setReadPermission(true)) .setOwner(new RolePermissions().setExecutePermission(true).setReadPermission(true).setWritePermission(true)) .setOther(new RolePermissions().setReadPermission(true)); String group = "group"; String owner = "owner"; client.setPermissionsWithResponse(permissions, group, owner, requestConditions).subscribe( response -> System.out.printf("Last Modified Time: %s", response.getValue().getLastModified()));For more information, see the Azure Docs
- Parameters:
permissions-PathPermissionsgroup- The group of the resource.owner- The owner of the resource.requestConditions-DataLakeRequestConditions- Returns:
- A reactive response containing the resource info.
-
setAccessControlRecursive
public Mono<AccessControlChangeResult> setAccessControlRecursive(List<PathAccessControlEntry> accessControlList)
Recursively sets the access control on a path and all subpaths.Code Samples
PathAccessControlEntry pathAccessControlEntry = new PathAccessControlEntry() .setEntityId("entityId") .setPermissions(new RolePermissions().setReadPermission(true)); List<PathAccessControlEntry> pathAccessControlEntries = new ArrayList<>(); pathAccessControlEntries.add(pathAccessControlEntry); client.setAccessControlRecursive(pathAccessControlEntries).subscribe( response -> System.out.printf("Successful changed file operations: %d", response.getCounters().getChangedFilesCount()));For more information, see the Azure Docs
- Parameters:
accessControlList- The POSIX access control list for the file or directory.- Returns:
- A reactive response containing the result of the operation.
- Throws:
DataLakeAclChangeFailedException- if a request to storage throws aDataLakeStorageExceptionor aExceptionto wrap the exception with the continuation token.
-
setAccessControlRecursiveWithResponse
public Mono<com.azure.core.http.rest.Response<AccessControlChangeResult>> setAccessControlRecursiveWithResponse(PathSetAccessControlRecursiveOptions options)
Recursively sets the access control on a path and all subpaths.Code Samples
PathAccessControlEntry pathAccessControlEntry = new PathAccessControlEntry() .setEntityId("entityId") .setPermissions(new RolePermissions().setReadPermission(true)); List<PathAccessControlEntry> pathAccessControlEntries = new ArrayList<>(); pathAccessControlEntries.add(pathAccessControlEntry); Integer batchSize = 2; Integer maxBatches = 10; boolean continueOnFailure = false; String continuationToken = null; Consumer<Response<AccessControlChanges>> progressHandler = response -> System.out.println("Received response"); PathSetAccessControlRecursiveOptions options = new PathSetAccessControlRecursiveOptions(pathAccessControlEntries) .setBatchSize(batchSize) .setMaxBatches(maxBatches) .setContinueOnFailure(continueOnFailure) .setContinuationToken(continuationToken) .setProgressHandler(progressHandler); client.setAccessControlRecursive(pathAccessControlEntries).subscribe( response -> System.out.printf("Successful changed file operations: %d", response.getCounters().getChangedFilesCount()));For more information, see the Azure Docs
- Parameters:
options-PathSetAccessControlRecursiveOptions- Returns:
- A reactive response containing the result of the operation.
- Throws:
DataLakeAclChangeFailedException- if a request to storage throws aDataLakeStorageExceptionor aExceptionto wrap the exception with the continuation token.
-
updateAccessControlRecursive
public Mono<AccessControlChangeResult> updateAccessControlRecursive(List<PathAccessControlEntry> accessControlList)
Recursively updates the access control on a path and all subpaths.Code Samples
PathAccessControlEntry pathAccessControlEntry = new PathAccessControlEntry() .setEntityId("entityId") .setPermissions(new RolePermissions().setReadPermission(true)); List<PathAccessControlEntry> pathAccessControlEntries = new ArrayList<>(); pathAccessControlEntries.add(pathAccessControlEntry); client.updateAccessControlRecursive(pathAccessControlEntries).subscribe( response -> System.out.printf("Successful changed file operations: %d", response.getCounters().getChangedFilesCount()));For more information, see the Azure Docs
- Parameters:
accessControlList- The POSIX access control list for the file or directory.- Returns:
- A reactive response containing the result of the operation.
- Throws:
DataLakeAclChangeFailedException- if a request to storage throws aDataLakeStorageExceptionor aExceptionto wrap the exception with the continuation token.
-
updateAccessControlRecursiveWithResponse
public Mono<com.azure.core.http.rest.Response<AccessControlChangeResult>> updateAccessControlRecursiveWithResponse(PathUpdateAccessControlRecursiveOptions options)
Recursively updates the access control on a path and all subpaths.Code Samples
PathAccessControlEntry pathAccessControlEntry = new PathAccessControlEntry() .setEntityId("entityId") .setPermissions(new RolePermissions().setReadPermission(true)); List<PathAccessControlEntry> pathAccessControlEntries = new ArrayList<>(); pathAccessControlEntries.add(pathAccessControlEntry); Integer batchSize = 2; Integer maxBatches = 10; boolean continueOnFailure = false; String continuationToken = null; Consumer<Response<AccessControlChanges>> progressHandler = response -> System.out.println("Received response"); PathUpdateAccessControlRecursiveOptions options = new PathUpdateAccessControlRecursiveOptions(pathAccessControlEntries) .setBatchSize(batchSize) .setMaxBatches(maxBatches) .setContinueOnFailure(continueOnFailure) .setContinuationToken(continuationToken) .setProgressHandler(progressHandler); client.updateAccessControlRecursive(pathAccessControlEntries).subscribe( response -> System.out.printf("Successful changed file operations: %d", response.getCounters().getChangedFilesCount()));For more information, see the Azure Docs
- Parameters:
options-PathUpdateAccessControlRecursiveOptions- Returns:
- A reactive response containing the result of the operation.
- Throws:
DataLakeAclChangeFailedException- if a request to storage throws aDataLakeStorageExceptionor aExceptionto wrap the exception with the continuation token.
-
removeAccessControlRecursive
public Mono<AccessControlChangeResult> removeAccessControlRecursive(List<PathRemoveAccessControlEntry> accessControlList)
Recursively removes the access control on a path and all subpaths.Code Samples
PathRemoveAccessControlEntry pathAccessControlEntry = new PathRemoveAccessControlEntry() .setEntityId("entityId"); List<PathRemoveAccessControlEntry> pathAccessControlEntries = new ArrayList<>(); pathAccessControlEntries.add(pathAccessControlEntry); client.removeAccessControlRecursive(pathAccessControlEntries).subscribe( response -> System.out.printf("Successful changed file operations: %d", response.getCounters().getChangedFilesCount()));For more information, see the Azure Docs
- Parameters:
accessControlList- The POSIX access control list for the file or directory.- Returns:
- A reactive response containing the result of the operation.
- Throws:
DataLakeAclChangeFailedException- if a request to storage throws aDataLakeStorageExceptionor aExceptionto wrap the exception with the continuation token.
-
removeAccessControlRecursiveWithResponse
public Mono<com.azure.core.http.rest.Response<AccessControlChangeResult>> removeAccessControlRecursiveWithResponse(PathRemoveAccessControlRecursiveOptions options)
Recursively removes the access control on a path and all subpaths.Code Samples
PathRemoveAccessControlEntry pathAccessControlEntry = new PathRemoveAccessControlEntry() .setEntityId("entityId"); List<PathRemoveAccessControlEntry> pathAccessControlEntries = new ArrayList<>(); pathAccessControlEntries.add(pathAccessControlEntry); Integer batchSize = 2; Integer maxBatches = 10; boolean continueOnFailure = false; String continuationToken = null; Consumer<Response<AccessControlChanges>> progressHandler = response -> System.out.println("Received response"); PathRemoveAccessControlRecursiveOptions options = new PathRemoveAccessControlRecursiveOptions(pathAccessControlEntries) .setBatchSize(batchSize) .setMaxBatches(maxBatches) .setContinueOnFailure(continueOnFailure) .setContinuationToken(continuationToken) .setProgressHandler(progressHandler); client.removeAccessControlRecursive(pathAccessControlEntries).subscribe( response -> System.out.printf("Successful changed file operations: %d", response.getCounters().getChangedFilesCount()));For more information, see the Azure Docs
- Parameters:
options-PathRemoveAccessControlRecursiveOptions- Returns:
- A reactive response containing the result of the operation.
- Throws:
DataLakeAclChangeFailedException- if a request to storage throws aDataLakeStorageExceptionor aExceptionto wrap the exception with the continuation token.
-
getAccessControl
public Mono<PathAccessControl> getAccessControl()
Returns the access control for a resource.Code Samples
client.getAccessControl().subscribe( response -> System.out.printf("Access Control List: %s, Group: %s, Owner: %s, Permissions: %s", PathAccessControlEntry.serializeList(response.getAccessControlList()), response.getGroup(), response.getOwner(), response.getPermissions()));For more information, see the Azure Docs
- Returns:
- A reactive response containing the resource access control.
-
getAccessControlWithResponse
public Mono<com.azure.core.http.rest.Response<PathAccessControl>> getAccessControlWithResponse(boolean userPrincipalNameReturned, DataLakeRequestConditions requestConditions)
Returns the access control for a resource.Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions().setLeaseId(leaseId); boolean userPrincipalNameReturned = false; client.getAccessControlWithResponse(userPrincipalNameReturned, requestConditions).subscribe( response -> System.out.printf("Access Control List: %s, Group: %s, Owner: %s, Permissions: %s", PathAccessControlEntry.serializeList(response.getValue().getAccessControlList()), response.getValue().getGroup(), response.getValue().getOwner(), response.getValue().getPermissions()));For more information, see the Azure Docs
- Parameters:
userPrincipalNameReturned- When true, user identity values returned as User Principal Names. When false, user identity values returned as Azure Active Directory Object IDs. Default value is false.requestConditions-DataLakeRequestConditions- Returns:
- A reactive response containing the resource access control.
-
generateUserDelegationSas
public String generateUserDelegationSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues, UserDelegationKey userDelegationKey)
Generates a user delegation SAS for the path using the specifiedDataLakeServiceSasSignatureValues.See
DataLakeServiceSasSignatureValuesfor more information on how to construct a user delegation SAS.Code Samples
OffsetDateTime myExpiryTime = OffsetDateTime.now().plusDays(1); PathSasPermission myPermission = new PathSasPermission().setReadPermission(true); DataLakeServiceSasSignatureValues myValues = new DataLakeServiceSasSignatureValues(expiryTime, permission) .setStartTime(OffsetDateTime.now()); client.generateUserDelegationSas(values, userDelegationKey);- Parameters:
dataLakeServiceSasSignatureValues-DataLakeServiceSasSignatureValuesuserDelegationKey- AUserDelegationKeyobject used to sign the SAS values. SeeDataLakeServiceAsyncClient.getUserDelegationKey(OffsetDateTime, OffsetDateTime)for more information on how to get a user delegation key.- Returns:
- A
Stringrepresenting the SAS query parameters.
-
generateUserDelegationSas
public String generateUserDelegationSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues, UserDelegationKey userDelegationKey, String accountName, com.azure.core.util.Context context)
Generates a user delegation SAS for the path using the specifiedDataLakeServiceSasSignatureValues.See
DataLakeServiceSasSignatureValuesfor more information on how to construct a user delegation SAS.Code Samples
OffsetDateTime myExpiryTime = OffsetDateTime.now().plusDays(1); PathSasPermission myPermission = new PathSasPermission().setReadPermission(true); DataLakeServiceSasSignatureValues myValues = new DataLakeServiceSasSignatureValues(expiryTime, permission) .setStartTime(OffsetDateTime.now()); client.generateUserDelegationSas(values, userDelegationKey, accountName, new Context("key", "value"));- Parameters:
dataLakeServiceSasSignatureValues-DataLakeServiceSasSignatureValuesuserDelegationKey- AUserDelegationKeyobject used to sign the SAS values. SeeDataLakeServiceAsyncClient.getUserDelegationKey(OffsetDateTime, OffsetDateTime)for more information on how to get a user delegation key.accountName- The account name.context- Additional context that is passed through the code when generating a SAS.- Returns:
- A
Stringrepresenting the SAS query parameters.
-
generateSas
public String generateSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues)
Generates a service SAS for the path using the specifiedDataLakeServiceSasSignatureValuesNote : The client must be authenticated via
StorageSharedKeyCredentialSee
DataLakeServiceSasSignatureValuesfor more information on how to construct a service SAS.Code Samples
OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); PathSasPermission permission = new PathSasPermission().setReadPermission(true); DataLakeServiceSasSignatureValues values = new DataLakeServiceSasSignatureValues(expiryTime, permission) .setStartTime(OffsetDateTime.now()); client.generateSas(values); // Client must be authenticated via StorageSharedKeyCredential- Parameters:
dataLakeServiceSasSignatureValues-DataLakeServiceSasSignatureValues- Returns:
- A
Stringrepresenting the SAS query parameters.
-
generateSas
public String generateSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues, com.azure.core.util.Context context)
Generates a service SAS for the path using the specifiedDataLakeServiceSasSignatureValuesNote : The client must be authenticated via
StorageSharedKeyCredentialSee
DataLakeServiceSasSignatureValuesfor more information on how to construct a service SAS.Code Samples
OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1); PathSasPermission permission = new PathSasPermission().setReadPermission(true); DataLakeServiceSasSignatureValues values = new DataLakeServiceSasSignatureValues(expiryTime, permission) .setStartTime(OffsetDateTime.now()); // Client must be authenticated via StorageSharedKeyCredential client.generateSas(values, new Context("key", "value"));- Parameters:
dataLakeServiceSasSignatureValues-DataLakeServiceSasSignatureValuescontext- Additional context that is passed through the code when generating a SAS.- Returns:
- A
Stringrepresenting the SAS query parameters.
-
-