public class DataLakePathAsyncClient extends Object
Modifier and Type | Method and Description |
---|---|
Mono<PathInfo> |
create()
Creates a resource.
|
Mono<PathInfo> |
create(boolean overwrite)
Creates a resource.
|
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> |
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.
|
String |
generateSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues)
Generates a service SAS for the path using the specified
DataLakeServiceSasSignatureValues
Note : The client must be authenticated via StorageSharedKeyCredential |
String |
generateUserDelegationSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues,
UserDelegationKey userDelegationKey)
Generates a user delegation SAS for the path using the specified
DataLakeServiceSasSignatureValues . |
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.
|
String |
getAccountName()
Gets the associated account name.
|
String |
getFileSystemName()
Gets the name of the File System in which this object lives.
|
com.azure.core.http.HttpPipeline |
getHttpPipeline()
Gets the
HttpPipeline powering this client. |
Mono<PathProperties> |
getProperties()
Returns the resources's metadata and properties.
|
Mono<com.azure.core.http.rest.Response<PathProperties>> |
getPropertiesWithResponse(DataLakeRequestConditions requestConditions)
Returns the resource's metadata and properties.
|
DataLakeServiceVersion |
getServiceVersion()
Gets the service version the client is using.
|
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<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 resources'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.
|
public String getAccountName()
public String getFileSystemName()
public com.azure.core.http.HttpPipeline getHttpPipeline()
HttpPipeline
powering this client.public DataLakeServiceVersion getServiceVersion()
public Mono<PathInfo> create()
Code Samples
client.create().subscribe(response -> System.out.printf("Last Modified Time:%s", response.getLastModified()));
For more information see the Azure Docs
public Mono<PathInfo> create(boolean overwrite)
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
overwrite
- Whether or not to overwrite, should data exist on the file.public Mono<com.azure.core.http.rest.Response<PathInfo>> createWithResponse(String permissions, String umask, PathHttpHeaders headers, Map<String,String> metadata, DataLakeRequestConditions requestConditions)
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
permissions
- POSIX access permissions for the resource owner, the resource owning group, and others.umask
- Restricts permissions of the resource to be created.headers
- PathHttpHeaders
metadata
- Metadata to associate with the resource.requestConditions
- DataLakeRequestConditions
Mono
containing a Response
whose value
contains a PathItem
.public Mono<Void> setMetadata(Map<String,String> metadata)
Code Samples
client.setMetadata(Collections.singletonMap("metadata", "value")) .subscribe(response -> System.out.println("Set metadata completed"));
For more information, see the Azure Docs
metadata
- Metadata to associate with the resource.public Mono<com.azure.core.http.rest.Response<Void>> setMetadataWithResponse(Map<String,String> metadata, DataLakeRequestConditions requestConditions)
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
metadata
- Metadata to associate with the resource.requestConditions
- DataLakeRequestConditions
public Mono<Void> setHttpHeaders(PathHttpHeaders headers)
Code Samples
client.setHttpHeaders(new PathHttpHeaders() .setContentLanguage("en-US") .setContentType("binary"));
For more information, see the Azure Docs
headers
- PathHttpHeaders
public Mono<com.azure.core.http.rest.Response<Void>> setHttpHeadersWithResponse(PathHttpHeaders headers, DataLakeRequestConditions requestConditions)
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
headers
- PathHttpHeaders
requestConditions
- DataLakeRequestConditions
public Mono<PathProperties> getProperties()
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
public Mono<com.azure.core.http.rest.Response<PathProperties>> getPropertiesWithResponse(DataLakeRequestConditions requestConditions)
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
requestConditions
- DataLakeRequestConditions
public Mono<Boolean> exists()
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));
public Mono<com.azure.core.http.rest.Response<Boolean>> existsWithResponse()
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()));
public Mono<PathInfo> setAccessControlList(List<PathAccessControlEntry> accessControlList, String group, String owner)
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
accessControlList
- A list of PathAccessControlEntry
objects.group
- The group of the resource.owner
- The owner of the resource.public Mono<com.azure.core.http.rest.Response<PathInfo>> setAccessControlListWithResponse(List<PathAccessControlEntry> accessControlList, String group, String owner, DataLakeRequestConditions requestConditions)
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
accessControlList
- A list of PathAccessControlEntry
objects.group
- The group of the resource.owner
- The owner of the resource.requestConditions
- DataLakeRequestConditions
public Mono<PathInfo> setPermissions(PathPermissions permissions, String group, String owner)
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
permissions
- PathPermissions
group
- The group of the resource.owner
- The owner of the resource.public Mono<com.azure.core.http.rest.Response<PathInfo>> setPermissionsWithResponse(PathPermissions permissions, String group, String owner, DataLakeRequestConditions requestConditions)
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
permissions
- PathPermissions
group
- The group of the resource.owner
- The owner of the resource.requestConditions
- DataLakeRequestConditions
public Mono<PathAccessControl> getAccessControl()
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
public Mono<com.azure.core.http.rest.Response<PathAccessControl>> getAccessControlWithResponse(boolean userPrincipalNameReturned, DataLakeRequestConditions requestConditions)
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
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
public String generateUserDelegationSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues, UserDelegationKey userDelegationKey)
DataLakeServiceSasSignatureValues
.
See DataLakeServiceSasSignatureValues
for 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);
dataLakeServiceSasSignatureValues
- DataLakeServiceSasSignatureValues
userDelegationKey
- A UserDelegationKey
object used to sign the SAS values.String
representing all SAS query parameters.for more information on how
to get a user delegation key.
public String generateSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues)
DataLakeServiceSasSignatureValues
Note : The client must be authenticated via StorageSharedKeyCredential
See DataLakeServiceSasSignatureValues
for 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
dataLakeServiceSasSignatureValues
- DataLakeServiceSasSignatureValues
String
representing all SAS query parameters.Copyright © 2020 Microsoft Corporation. All rights reserved.