public final class DataLakeDirectoryAsyncClient extends DataLakePathAsyncClient
This client is instantiated through DataLakePathClientBuilder or retrieved via
getDirectoryAsyncClient.
Please refer to the Azure Docs for more information.
| Modifier and Type | Method and Description |
|---|---|
Mono<DataLakeFileAsyncClient> |
createFile(String fileName)
Creates a new file within a directory.
|
Mono<DataLakeFileAsyncClient> |
createFile(String fileName,
boolean overwrite)
Creates a new file within a directory.
|
Mono<com.azure.core.http.rest.Response<DataLakeFileAsyncClient>> |
createFileWithResponse(String fileName,
String permissions,
String umask,
PathHttpHeaders headers,
Map<String,String> metadata,
DataLakeRequestConditions requestConditions)
Creates a new file within a directory.
|
Mono<DataLakeDirectoryAsyncClient> |
createSubdirectory(String subdirectoryName)
Creates a new sub-directory within a directory.
|
Mono<DataLakeDirectoryAsyncClient> |
createSubdirectory(String subdirectoryName,
boolean overwrite)
Creates a new sub-directory within a directory.
|
Mono<com.azure.core.http.rest.Response<DataLakeDirectoryAsyncClient>> |
createSubdirectoryWithResponse(String subdirectoryName,
String permissions,
String umask,
PathHttpHeaders headers,
Map<String,String> metadata,
DataLakeRequestConditions requestConditions)
Creates a new sub-directory within a directory.
|
Mono<Void> |
delete()
Deletes a directory.
|
Mono<Void> |
deleteFile(String fileName)
Deletes the specified file in the file system.
|
Mono<com.azure.core.http.rest.Response<Void>> |
deleteFileWithResponse(String fileName,
DataLakeRequestConditions requestConditions)
Deletes the specified file in the directory.
|
Mono<Void> |
deleteSubdirectory(String subdirectoryName)
Deletes the specified sub-directory in the directory.
|
Mono<com.azure.core.http.rest.Response<Void>> |
deleteSubdirectoryWithResponse(String directoryName,
boolean recursive,
DataLakeRequestConditions requestConditions)
Deletes the specified sub-directory in the directory.
|
Mono<com.azure.core.http.rest.Response<Void>> |
deleteWithResponse(boolean recursive,
DataLakeRequestConditions requestConditions)
Deletes a directory.
|
String |
getDirectoryName()
Gets the name of this directory, not including its full path.
|
String |
getDirectoryPath()
Gets the path of this directory, not including the name of the resource itself.
|
String |
getDirectoryUrl()
Gets the URL of the directory represented by this client on the Data Lake service.
|
DataLakeFileAsyncClient |
getFileAsyncClient(String fileName)
Creates a new DataLakeFileAsyncClient object by concatenating fileName to the end of
DataLakeDirectoryAsyncClient's URL.
|
DataLakeDirectoryAsyncClient |
getSubdirectoryAsyncClient(String subdirectoryName)
Creates a new DataLakeDirectoryAsyncClient object by concatenating subdirectoryName to the end of
DataLakeDirectoryAsyncClient's URL.
|
com.azure.core.http.rest.PagedFlux<PathItem> |
listPaths()
Returns a reactive Publisher emitting all the files/directories in this directory lazily as needed.
|
com.azure.core.http.rest.PagedFlux<PathItem> |
listPaths(boolean recursive,
boolean userPrincipleNameReturned,
Integer maxResults)
Returns a reactive Publisher emitting all the files/directories in this directory lazily as needed.
|
Mono<DataLakeDirectoryAsyncClient> |
rename(String destinationFileSystem,
String destinationPath)
Moves the directory to another location within the file system.
|
Mono<com.azure.core.http.rest.Response<DataLakeDirectoryAsyncClient>> |
renameWithResponse(String destinationFileSystem,
String destinationPath,
DataLakeRequestConditions sourceRequestConditions,
DataLakeRequestConditions destinationRequestConditions)
Moves the directory to another location within the file system.
|
create, create, createWithResponse, exists, existsWithResponse, generateSas, generateSas, generateUserDelegationSas, generateUserDelegationSas, getAccessControl, getAccessControlWithResponse, getAccountName, getFileSystemName, getHttpPipeline, getProperties, getPropertiesWithResponse, getServiceVersion, removeAccessControlRecursive, removeAccessControlRecursiveWithResponse, setAccessControlList, setAccessControlListWithResponse, setAccessControlRecursive, setAccessControlRecursiveWithResponse, setHttpHeaders, setHttpHeadersWithResponse, setMetadata, setMetadataWithResponse, setPermissions, setPermissionsWithResponse, updateAccessControlRecursive, updateAccessControlRecursiveWithResponsepublic String getDirectoryUrl()
public String getDirectoryPath()
public String getDirectoryName()
public Mono<Void> delete()
Code Samples
client.delete().subscribe(response ->
System.out.println("Delete request completed"));
For more information see the Azure Docs
public Mono<com.azure.core.http.rest.Response<Void>> deleteWithResponse(boolean recursive, DataLakeRequestConditions requestConditions)
Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId);
boolean recursive = false; // Default value
client.deleteWithResponse(recursive, requestConditions)
.subscribe(response -> System.out.println("Delete request completed"));
For more information see the Azure Docs
recursive - Whether or not to delete all paths beneath the directory.requestConditions - DataLakeRequestConditionspublic DataLakeFileAsyncClient getFileAsyncClient(String fileName)
Code Samples
DataLakeFileAsyncClient dataLakeFileClient = client.getFileAsyncClient(fileName);
fileName - A String representing the name of the file.DataLakeFileAsyncClient object which references the file with the specified name in this
file system.public Mono<DataLakeFileAsyncClient> createFile(String fileName)
Code Samples
DataLakeFileAsyncClient fileClient = client.createFile(fileName).block();
fileName - Name of the file to create.Mono containing a DataLakeFileAsyncClient used to interact with the file created.public Mono<DataLakeFileAsyncClient> createFile(String fileName, boolean overwrite)
Code Samples
boolean overwrite = false; /* Default value. */ DataLakeFileAsyncClient fClient = client.createFile(fileName, overwrite).block();
fileName - Name of the file to create.overwrite - Whether or not to overwrite, should the file exist.Mono containing a DataLakeFileAsyncClient used to interact with the file created.public Mono<com.azure.core.http.rest.Response<DataLakeFileAsyncClient>> createFileWithResponse(String fileName, 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";
DataLakeFileAsyncClient newFileClient = client.createFileWithResponse(fileName,
permissions, umask, httpHeaders, Collections.singletonMap("metadata", "value"), requestConditions
).block().getValue();
fileName - Name of the file to create.permissions - POSIX access permissions for the file owner, the file owning group, and others.umask - Restricts permissions of the file to be created.headers - PathHttpHeadersmetadata - Metadata to associate with the file. If there is leading or trailing whitespace in any
metadata key or value, it must be removed or encoded.requestConditions - DataLakeRequestConditionsMono containing a Response whose value contains a DataLakeFileAsyncClient used to interact with the file created.public Mono<Void> deleteFile(String fileName)
Code Samples
client.deleteFile(fileName).subscribe(response ->
System.out.println("Delete request completed"));
fileName - Name of the file to delete.public Mono<com.azure.core.http.rest.Response<Void>> deleteFileWithResponse(String fileName, DataLakeRequestConditions requestConditions)
Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId);
client.deleteFileWithResponse(fileName, requestConditions)
.subscribe(response -> System.out.println("Delete request completed"));
fileName - Name of the file to delete.requestConditions - DataLakeRequestConditionsMono containing containing status code and HTTP headerspublic DataLakeDirectoryAsyncClient getSubdirectoryAsyncClient(String subdirectoryName)
Code Samples
DataLakeDirectoryAsyncClient dataLakeDirectoryClient = client.getSubdirectoryAsyncClient(directoryName);
subdirectoryName - A String representing the name of the sub-directory.DataLakeDirectoryAsyncClient object which references the directory with the specified name
in this file system.public Mono<DataLakeDirectoryAsyncClient> createSubdirectory(String subdirectoryName)
Code Samples
DataLakeDirectoryAsyncClient directoryClient = client.createSubdirectory(directoryName).block();
subdirectoryName - Name of the sub-directory to create.Mono containing a DataLakeDirectoryAsyncClient used to interact with the directory
created.public Mono<DataLakeDirectoryAsyncClient> createSubdirectory(String subdirectoryName, boolean overwrite)
Code Samples
boolean overwrite = false; /* Default value. */ DataLakeDirectoryAsyncClient dClient = client.createSubdirectory(directoryName, overwrite).block();
subdirectoryName - Name of the sub-directory to create.overwrite - Whether or not to overwrite, should the sub directory exist.Mono containing a DataLakeDirectoryAsyncClient used to interact with the directory
created.public Mono<com.azure.core.http.rest.Response<DataLakeDirectoryAsyncClient>> createSubdirectoryWithResponse(String subdirectoryName, 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";
DataLakeDirectoryAsyncClient newDirectoryClient = client.createSubdirectoryWithResponse(
directoryName, permissions, umask, httpHeaders, Collections.singletonMap("metadata", "value"),
requestConditions
).block().getValue();
subdirectoryName - Name of the sub-directory to create.permissions - POSIX access permissions for the sub-directory owner, the sub-directory owning group, and
others.umask - Restricts permissions of the sub-directory 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 - DataLakeRequestConditionsMono containing a Response whose value contains a DataLakeDirectoryAsyncClient used to interact with the sub-directory created.public Mono<Void> deleteSubdirectory(String subdirectoryName)
Code Samples
client.deleteSubdirectory(directoryName).subscribe(response ->
System.out.println("Delete request completed"));
subdirectoryName - Name of the sub-directory to delete.public Mono<com.azure.core.http.rest.Response<Void>> deleteSubdirectoryWithResponse(String directoryName, boolean recursive, DataLakeRequestConditions requestConditions)
Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId);
boolean recursive = false; // Default value
client.deleteSubdirectoryWithResponse(directoryName, recursive, requestConditions)
.subscribe(response -> System.out.println("Delete request completed"));
directoryName - Name of the sub-directory to delete.recursive - Whether or not to delete all paths beneath the sub-directory.requestConditions - DataLakeRequestConditionsMono containing containing status code and HTTP headerspublic Mono<DataLakeDirectoryAsyncClient> rename(String destinationFileSystem, String destinationPath)
Code Samples
DataLakeDirectoryAsyncClient renamedClient = client.rename(fileSystemName, destinationPath).block();
System.out.println("Directory Client has been renamed");
destinationFileSystem - The file system of the destination within the account.
null for the current file system.destinationPath - Relative path from the file system to rename the directory to, excludes the file system
name. For example if you want to move a directory with fileSystem = "myfilesystem", path = "mydir/mysubdir" to
another path in myfilesystem (ex: newdir) then set the destinationPath = "newdir"Mono containing a DataLakeDirectoryAsyncClient used to interact with the new directory
created.public Mono<com.azure.core.http.rest.Response<DataLakeDirectoryAsyncClient>> renameWithResponse(String destinationFileSystem, String destinationPath, DataLakeRequestConditions sourceRequestConditions, DataLakeRequestConditions destinationRequestConditions)
Code Samples
DataLakeRequestConditions sourceRequestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId);
DataLakeRequestConditions destinationRequestConditions = new DataLakeRequestConditions();
DataLakeDirectoryAsyncClient newRenamedClient = client.renameWithResponse(fileSystemName, destinationPath,
sourceRequestConditions, destinationRequestConditions).block().getValue();
System.out.println("Directory Client has been renamed");
destinationFileSystem - The file system of the destination within the account.
null for the current file system.destinationPath - Relative path from the file system to rename the directory to, excludes the file system
name. For example if you want to move a directory with fileSystem = "myfilesystem", path = "mydir/mysubdir" to
another path in myfilesystem (ex: newdir) then set the destinationPath = "newdir"sourceRequestConditions - DataLakeRequestConditions against the source.destinationRequestConditions - DataLakeRequestConditions against the destination.Mono containing a Response whose value contains a DataLakeDirectoryAsyncClient used to interact with the directory created.public com.azure.core.http.rest.PagedFlux<PathItem> listPaths()
Code Samples
client.listPaths().subscribe(path -> System.out.printf("Name: %s%n", path.getName()));
public com.azure.core.http.rest.PagedFlux<PathItem> listPaths(boolean recursive, boolean userPrincipleNameReturned, Integer maxResults)
Code Samples
client.listPaths(false, false, 10)
.subscribe(path -> System.out.printf("Name: %s%n", path.getName()));
recursive - Specifies if the call should recursively include all paths.userPrincipleNameReturned - If "true", the user identity values returned in the x-ms-owner, x-ms-group,
and x-ms-acl response headers will be transformed from Azure Active Directory Object IDs to User Principal Names.
If "false", the values will be returned as Azure Active Directory Object IDs.
The default value is false. Note that group and application Object IDs are not translated because they do not
have unique friendly names.maxResults - Specifies the maximum number of blobs to return, including all BlobPrefix elements. If the
request does not specify maxResults or specifies a value greater than 5,000, the server will return up to
5,000 items.Copyright © 2021 Microsoft Corporation. All rights reserved.