DataLakeFileSystemAsyncClient Class
- java.
lang. Object - com.
azure. storage. file. datalake. DataLakeFileSystemAsyncClient
- com.
public class DataLakeFileSystemAsyncClient
Client to a file system. It may only be instantiated through a DataLakeFileSystemClientBuilder or via the method getFileSystemAsyncClient(String fileSystemName). This class does not hold any state about a particular blob but is instead a convenient way of sending off appropriate requests to the resource on the service. It may also be used to construct clients for files/directories.
This client contains operations on a file system. Operations on a path are available on DataLakeFileAsyncClient and DataLakeDirectoryAsyncClient through getFileAsyncClient(String fileName) and getDirectoryAsyncClient(String directoryName) respectively, and operations on the service are available on DataLakeServiceAsyncClient.
Please refer to the Azure Docs for more information on file systems.
Note this client is an async client that returns reactive responses from Spring Reactor Core project (https://projectreactor.io/). Calling the methods in this client will NOT start the actual network operation, until .subscribe()
is called on the reactive response. You can simply convert one of these responses to a CompletableFuture object through Mono#toFuture().
Field Summary
Modifier and Type | Field and Description |
---|---|
static final String |
ROOT_DIRECTORY_NAME
Special directory name for the root directory of the file system. |
static final String |
ROOT_FILESYSTEM_NAME
Special file system name for the root file system in the Storage account. |
Method Summary
Methods inherited from java.lang.Object
Field Details
ROOT_DIRECTORY_NAME
public static final String ROOT_DIRECTORY_NAME
Special directory name for the root directory of the file system.
This should only be used while getting the root directory from the file system client.
ROOT_FILESYSTEM_NAME
public static final String ROOT_FILESYSTEM_NAME
Special file system name for the root file system in the Storage account.
Method Details
create
public Mono
Creates a new file system within a storage account. If a file system with the same name already exists, the operation fails. For more information, see the Azure Docs.
Code Samples
client.create().subscribe(
response -> System.out.printf("Create completed%n"),
error -> System.out.printf("Error while creating file system %s%n", error));
Returns:
createDirectory
public Mono
Creates a new directory within a file system. By default, this method will not overwrite an existing directory. For more information, see the Azure Docs.
Code Samples
Mono<DataLakeDirectoryAsyncClient> directoryClient = client.createDirectory(directoryName);
Parameters:
Returns:
createDirectory
public Mono
Creates a new directory within a file system. For more information, see the Azure Docs.
Code Samples
boolean overwrite = false; /* Default value. */
Mono<DataLakeDirectoryAsyncClient> dClient = client.createDirectory(directoryName, overwrite);
Parameters:
Returns:
createDirectoryIfNotExists
public Mono
Creates a new directory within a file system if it does not exist. For more information, see the Azure Docs.
Code Samples
DataLakeDirectoryAsyncClient directoryAsyncClient = client.createDirectoryIfNotExists(directoryName).block();
Parameters:
Returns:
createDirectoryIfNotExistsWithResponse
public Mono
Creates a new directory within a file system if it does not exist. For more information, see the Azure Docs.
Code Samples
PathHttpHeaders headers = new PathHttpHeaders()
.setContentLanguage("en-US")
.setContentType("binary");
String permissions = "permissions";
String umask = "umask";
DataLakePathCreateOptions options = new DataLakePathCreateOptions()
.setPermissions(permissions)
.setUmask(umask)
.setPathHttpHeaders(headers)
.setMetadata(Collections.singletonMap("metadata", "value"));
client.createDirectoryIfNotExistsWithResponse(directoryName, options).subscribe(response -> {
if (response.getStatusCode() == 409) {
System.out.println("Already exists.");
} else {
System.out.println("successfully created.");
}
});
Parameters:
Returns:
createDirectoryWithResponse
public Mono
Creates a new directory within a file system. If a directory with the same name already exists, the directory will be overwritten. For more information, see the Azure Docs.
Code Samples
PathHttpHeaders httpHeaders = new PathHttpHeaders()
.setContentLanguage("en-US")
.setContentType("binary");
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId);
Map<String, String> metadata = Collections.singletonMap("metadata", "value");
String permissions = "permissions";
String umask = "umask";
String owner = "rwx";
String group = "r--";
String leaseId = CoreUtils.randomUuid().toString();
Integer duration = 15;
DataLakePathCreateOptions options = new DataLakePathCreateOptions()
.setPermissions(permissions)
.setUmask(umask)
.setOwner(owner)
.setGroup(group)
.setPathHttpHeaders(httpHeaders)
.setRequestConditions(requestConditions)
.setMetadata(metadata)
.setProposedLeaseId(leaseId)
.setLeaseDuration(duration);
Mono<Response<DataLakeDirectoryAsyncClient>> newDirectoryClient = client.createDirectoryWithResponse(
directoryName, options);
Parameters:
Returns:
createDirectoryWithResponse
public Mono
Creates a new directory within a file system. If a directory with the same name already exists, the directory will be overwritten. For more information, see the Azure Docs.
Code Samples
PathHttpHeaders httpHeaders = new PathHttpHeaders()
.setContentLanguage("en-US")
.setContentType("binary");
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId);
String permissions = "permissions";
String umask = "umask";
Mono<Response<DataLakeDirectoryAsyncClient>> newDirectoryClient = client.createDirectoryWithResponse(
directoryName, permissions, umask, httpHeaders, Collections.singletonMap("metadata", "value"),
requestConditions);
Parameters:
Returns:
createFile
public Mono
Creates a new file within a file system. By default, this method will not overwrite an existing file. For more information, see the Azure Docs.
Code Samples
Mono<DataLakeFileAsyncClient> fileClient = client.createFile(fileName);
Parameters:
Returns:
createFile
public Mono
Creates a new file within a file system. For more information, see the Azure Docs.
Code Samples
boolean overwrite = false; /* Default value. */
Mono<DataLakeFileAsyncClient> fClient = client.createFile(fileName, overwrite);
Parameters:
Returns:
createFileIfNotExists
public Mono
Creates a new file within a file system if it does not exist. For more information, see the Azure Docs.
Code Samples
DataLakeFileAsyncClient fileAsyncClient = client.createFileIfNotExists(fileName).block();
Parameters:
Returns:
createFileIfNotExistsWithResponse
public Mono
Creates a new file within a file system if it does not exist. For more information, see the Azure Docs.
Code Samples
PathHttpHeaders headers = new PathHttpHeaders()
.setContentLanguage("en-US")
.setContentType("binary");
String permissions = "permissions";
String umask = "umask";
DataLakePathCreateOptions options = new DataLakePathCreateOptions()
.setPermissions(permissions)
.setUmask(umask)
.setPathHttpHeaders(headers)
.setMetadata(Collections.singletonMap("metadata", "value"));
client.createFileIfNotExistsWithResponse(fileName, options).subscribe(response -> {
if (response.getStatusCode() == 409) {
System.out.println("Already exists.");
} else {
System.out.println("successfully created.");
}
});
Parameters:
Returns:
createFileWithResponse
public Mono
Creates a new file within a file system. If a file with the same name already exists, the file will be overwritten. For more information, see the Azure Docs.
Code Samples
PathHttpHeaders httpHeaders = new PathHttpHeaders()
.setContentLanguage("en-US")
.setContentType("binary");
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId);
Map<String, String> metadata = Collections.singletonMap("metadata", "value");
String permissions = "permissions";
String umask = "umask";
String owner = "rwx";
String group = "r--";
String leaseId = CoreUtils.randomUuid().toString();
Integer duration = 15;
DataLakePathCreateOptions options = new DataLakePathCreateOptions()
.setPermissions(permissions)
.setUmask(umask)
.setOwner(owner)
.setGroup(group)
.setPathHttpHeaders(httpHeaders)
.setRequestConditions(requestConditions)
.setMetadata(metadata)
.setProposedLeaseId(leaseId)
.setLeaseDuration(duration);
Mono<Response<DataLakeFileAsyncClient>> newFileClient = client.createFileWithResponse(fileName, options);
Parameters:
Returns:
createFileWithResponse
public Mono
Creates a new file within a file system. If a file with the same name already exists, the file will be overwritten. For more information, see the Azure Docs.
Code Samples
PathHttpHeaders httpHeaders = new PathHttpHeaders()
.setContentLanguage("en-US")
.setContentType("binary");
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId);
String permissions = "permissions";
String umask = "umask";
Mono<Response<DataLakeFileAsyncClient>> newFileClient = client.createFileWithResponse(fileName, permissions,
umask, httpHeaders, Collections.singletonMap("metadata", "value"), requestConditions);
Parameters:
Returns:
createIfNotExists
public Mono
Creates a new file system within a storage account if it does not exist. For more information, see the Azure Docs.
Code Samples
client.createIfNotExists().subscribe(created -> {
if (created) {
System.out.println("Successfully created.");
} else {
System.out.println("Already exists.");
}
});
Returns:
true
indicates that a new file system was created.
false
indicates that a file system already existed at this location.createIfNotExistsWithResponse
public Mono
Creates a new file system within a storage account if it does not exist. For more information, see the Azure Docs.
Code Samples
Map<String, String> metadata = Collections.singletonMap("metadata", "value");
client.createIfNotExistsWithResponse(metadata, PublicAccessType.CONTAINER).subscribe(response -> {
if (response.getStatusCode() == 409) {
System.out.println("Already exists.");
} else {
System.out.println("successfully created.");
}
});
Parameters:
Returns:
createWithResponse
public Mono
Creates a new file system within a storage account. If a file system with the same name already exists, the operation fails. For more information, see the Azure Docs.
Code Samples
Map<String, String> metadata = Collections.singletonMap("metadata", "value");
client.createWithResponse(metadata, PublicAccessType.CONTAINER).subscribe(response ->
System.out.printf("Create completed with status %d%n", response.getStatusCode()));
Parameters:
Returns:
delete
public Mono
Marks the specified file system for deletion. The file system and any files/directories contained within it are later deleted during garbage collection. For more information, see the Azure Docs.
Code Samples
client.delete().subscribe(
response -> System.out.printf("Delete completed%n"),
error -> System.out.printf("Delete failed: %s%n", error));
Returns:
deleteDirectory
public Mono
Deletes the specified directory in the file system. If the directory doesn't exist the operation fails. For more information see the Azure Docs.
Code Samples
client.deleteDirectory(directoryName).subscribe(response ->
System.out.println("Delete request completed"));
Parameters:
Returns:
deleteDirectoryIfExists
public Mono
Deletes the specified directory in the file system if it exists. For more information see the Azure Docs.
Code Samples
client.deleteDirectoryIfExists(fileName).subscribe(deleted -> {
if (deleted) {
System.out.println("Successfully deleted.");
} else {
System.out.println("Does not exist.");
}
});
Parameters:
Returns:
true
indicates that the specified directory was
successfully deleted, false
indicates that the specified directory did not exist.deleteDirectoryIfExistsWithResponse
public Mono
Deletes the specified directory in the file system if it exists. For more information see the Azure Docs.
Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId);
boolean recursive = false; // Default value
DataLakePathDeleteOptions options = new DataLakePathDeleteOptions().setIsRecursive(recursive)
.setRequestConditions(requestConditions);
client.deleteDirectoryIfExistsWithResponse(directoryName, options).subscribe(response -> {
if (response.getStatusCode() == 404) {
System.out.println("Does not exist.");
} else {
System.out.println("successfully deleted.");
}
});
Parameters:
Returns:
deleteDirectoryWithResponse
public Mono
Deletes the specified directory in the file system. If the directory doesn't exist the operation fails. For more information see the Azure Docs.
Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId);
boolean recursive = false; // Default value
client.deleteDirectoryWithResponse(directoryName, recursive, requestConditions)
.subscribe(response -> System.out.println("Delete request completed"));
Parameters:
Returns:
deleteFile
public Mono
Deletes the specified file in the file system. If the file doesn't exist the operation fails. For more information see the Azure Docs.
Code Samples
client.deleteFile(fileName).subscribe(response ->
System.out.println("Delete request completed"));
Parameters:
Returns:
deleteFileIfExists
public Mono
Deletes the specified file in the file system if it exists. For more information see the Azure Docs.
Code Samples
client.deleteFileIfExists(fileName).subscribe(deleted -> {
if (deleted) {
System.out.println("Successfully deleted.");
} else {
System.out.println("Does not exist.");
}
});
Parameters:
Returns:
true
indicates that the specified file was successfully
deleted, false
indicates that the specified file did not exist.deleteFileIfExistsWithResponse
public Mono
Deletes the specified file in the file system if it exists. For more information see the Azure Docs.
Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId);
DataLakePathDeleteOptions options = new DataLakePathDeleteOptions().setIsRecursive(false)
.setRequestConditions(requestConditions);
client.deleteFileIfExistsWithResponse(fileName, options).subscribe(response -> {
if (response.getStatusCode() == 404) {
System.out.println("Does not exist.");
} else {
System.out.println("successfully deleted.");
}
});
Parameters:
Returns:
deleteFileWithResponse
public Mono
Deletes the specified file in the file system. If the file doesn't exist the operation fails. For more information see the Azure Docs.
Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId);
client.deleteFileWithResponse(fileName, requestConditions)
.subscribe(response -> System.out.println("Delete request completed"));
Parameters:
Returns:
deleteIfExists
public Mono
Marks the specified file system for deletion if it exists. The file system and any files/directories contained within it are later deleted during garbage collection. For more information, see the Azure Docs.
Code Samples
client.deleteIfExists().subscribe(deleted -> {
if (deleted) {
System.out.println("Successfully deleted.");
} else {
System.out.println("Does not exist.");
}
});
Returns:
true
indicates that the file system was successfully
deleted, false
indicates that the file system did not exist.deleteIfExistsWithResponse
public Mono
Marks the specified file system for deletion if it exists. The file system and any files/directories contained within it are later deleted during garbage collection. For more information, see the Azure Docs.
Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId)
.setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3));
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.");
}
});
Parameters:
Returns:
deleteWithResponse
public Mono
Marks the specified file system for deletion. The file system and any files/directories contained within it are later deleted during garbage collection. For more information, see the Azure Docs.
Code Samples
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId)
.setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3));
client.deleteWithResponse(requestConditions).subscribe(response ->
System.out.printf("Delete completed with status %d%n", response.getStatusCode()));
Parameters:
Returns:
exists
public Mono
Determines if the file system exists in the cloud.
Code Samples
client.exists().subscribe(response -> System.out.printf("Exists? %b%n", response));
Returns:
existsWithResponse
public Mono
Determines if the file system exists in the cloud.
Code Samples
client.existsWithResponse().subscribe(response -> System.out.printf("Exists? %b%n", response.getValue()));
Returns:
generateSas
public String generateSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues)
Generates a service SAS for the file system using the specified 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);
FileSystemSasPermission permission = new FileSystemSasPermission().setReadPermission(true);
DataLakeServiceSasSignatureValues values = new DataLakeServiceSasSignatureValues(expiryTime, permission)
.setStartTime(OffsetDateTime.now());
client.generateSas(values); // Client must be authenticated via StorageSharedKeyCredential
Parameters:
Returns:
String
representing the SAS query parameters.generateSas
public String generateSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues, Context context)
Generates a service SAS for the file system using the specified 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);
FileSystemSasPermission permission = new FileSystemSasPermission().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:
Returns:
String
representing the SAS query parameters.generateSas
public String generateSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues, Consumer
Generates a service SAS for the file system using the specified DataLakeServiceSasSignatureValues
Note : The client must be authenticated via StorageSharedKeyCredential
See DataLakeServiceSasSignatureValues for more information on how to construct a service SAS.
Parameters:
Returns:
String
representing the SAS query parameters.generateUserDelegationSas
public String generateUserDelegationSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues, UserDelegationKey userDelegationKey)
Generates a user delegation SAS for the file system using the specified DataLakeServiceSasSignatureValues.
See DataLakeServiceSasSignatureValues for more information on how to construct a user delegation SAS.
Code Samples
OffsetDateTime myExpiryTime = OffsetDateTime.now().plusDays(1);
FileSystemSasPermission myPermission = new FileSystemSasPermission().setReadPermission(true);
DataLakeServiceSasSignatureValues myValues = new DataLakeServiceSasSignatureValues(expiryTime, permission)
.setStartTime(OffsetDateTime.now());
client.generateUserDelegationSas(values, userDelegationKey);
Parameters:
Returns:
String
representing the SAS query parameters.generateUserDelegationSas
public String generateUserDelegationSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues, UserDelegationKey userDelegationKey, String accountName, Context context)
Generates a user delegation SAS for the file system using the specified DataLakeServiceSasSignatureValues.
See DataLakeServiceSasSignatureValues for more information on how to construct a user delegation SAS.
Code Samples
OffsetDateTime myExpiryTime = OffsetDateTime.now().plusDays(1);
FileSystemSasPermission myPermission = new FileSystemSasPermission().setReadPermission(true);
DataLakeServiceSasSignatureValues myValues = new DataLakeServiceSasSignatureValues(expiryTime, permission)
.setStartTime(OffsetDateTime.now());
client.generateUserDelegationSas(values, userDelegationKey, accountName, new Context("key", "value"));
Parameters:
Returns:
String
representing the SAS query parameters.generateUserDelegationSas
public String generateUserDelegationSas(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues, UserDelegationKey userDelegationKey, String accountName, Consumer
Generates a user delegation SAS for the file system using the specified DataLakeServiceSasSignatureValues.
See DataLakeServiceSasSignatureValues for more information on how to construct a user delegation SAS.
Parameters:
Returns:
String
representing the SAS query parameters.getAccessPolicy
public Mono
Returns the file system's permissions. The permissions indicate whether file system's paths may be accessed publicly. For more information, see the Azure Docs.
Code Samples
client.getAccessPolicy().subscribe(response -> {
System.out.printf("Data Lake Access Type: %s%n", response.getDataLakeAccessType());
for (DataLakeSignedIdentifier identifier : response.getIdentifiers()) {
System.out.printf("Identifier Name: %s, Permissions %s%n",
identifier.getId(),
identifier.getAccessPolicy().getPermissions());
}
});
Returns:
getAccessPolicyWithResponse
public Mono
Returns the file system's permissions. The permissions indicate whether file system's paths may be accessed publicly. For more information, see the Azure Docs.
Code Samples
client.getAccessPolicyWithResponse(leaseId).subscribe(response -> {
System.out.printf("Data Lake Access Type: %s%n", response.getValue().getDataLakeAccessType());
for (DataLakeSignedIdentifier identifier : response.getValue().getIdentifiers()) {
System.out.printf("Identifier Name: %s, Permissions %s%n",
identifier.getId(),
identifier.getAccessPolicy().getPermissions());
}
});
Parameters:
Returns:
getAccountName
public String getAccountName()
Get associated account name.
Returns:
getAccountUrl
public String getAccountUrl()
Get the url of the storage account.
Returns:
getDirectoryAsyncClient
public DataLakeDirectoryAsyncClient getDirectoryAsyncClient(String directoryName)
Initializes a new DataLakeDirectoryAsyncClient object by concatenating directoryName to the end of DataLakeFileSystemAsyncClient's URL. The new DataLakeDirectoryAsyncClient uses the same request policy pipeline as the DataLakeFileSystemAsyncClient.
Code Samples
DataLakeDirectoryAsyncClient dataLakeDirectoryAsyncClient = client.getDirectoryAsyncClient(directoryName);
Parameters:
String
representing the name of the directory. If the path name contains special
characters, pass in the url encoded version of the path name.
Returns:
getFileAsyncClient
public DataLakeFileAsyncClient getFileAsyncClient(String fileName)
Initializes a new DataLakeFileAsyncClient object by concatenating fileName to the end of DataLakeFileSystemAsyncClient's URL. The new DataLakeFileAsyncClient uses the same request policy pipeline as the DataLakeFileSystemAsyncClient.
Code Samples
DataLakeFileAsyncClient dataLakeFileAsyncClient = client.getFileAsyncClient(fileName);
Parameters:
String
representing the name of the file. If the path name contains special characters,
pass in the url encoded version of the path name.
Returns:
getFileSystemName
public String getFileSystemName()
Get the file system name.
Code Samples
String fileSystemName = client.getFileSystemName();
System.out.println("The name of the file system is " + fileSystemName);
Returns:
getFileSystemUrl
public String getFileSystemUrl()
Gets the URL of the file system represented by this client.
Returns:
getHttpPipeline
public HttpPipeline getHttpPipeline()
Gets the HttpPipeline powering this client.
Returns:
getProperties
public Mono
Returns the file system's metadata and system properties. For more information, see the Azure Docs.
Code Samples
client.getProperties().subscribe(response ->
System.out.printf("Public Access Type: %s, Legal Hold? %b, Immutable? %b%n",
response.getDataLakePublicAccess(),
response.hasLegalHold(),
response.hasImmutabilityPolicy()));
Returns:
getPropertiesWithResponse
public Mono
Returns the file system's metadata and system properties. For more information, see the Azure Docs.
Code Samples
client.getPropertiesWithResponse(leaseId).subscribe(response ->
System.out.printf("Public Access Type: %s, Legal Hold? %b, Immutable? %b%n",
response.getValue().getDataLakePublicAccess(),
response.getValue().hasLegalHold(),
response.getValue().hasImmutabilityPolicy()));
Parameters:
Returns:
getServiceVersion
public DataLakeServiceVersion getServiceVersion()
Gets the service version the client is using.
Returns:
listDeletedPaths
public PagedFlux
Returns a reactive Publisher emitting all the files/directories in this filesystem that have been recently soft deleted lazily as needed. For more information, see the Azure Docs.
Code Samples
client.listDeletedPaths().subscribe(path -> System.out.printf("Name: %s%n", path.getPath()));
Returns:
listDeletedPaths
public PagedFlux
Returns a reactive Publisher emitting all the files/directories in this account lazily as needed. For more information, see the Azure Docs. Note: You can specify the page size by using byPaged methods that accept an integer such as PagedFlux#byPage(int). Please refer to the REST docs above for limitations on page size
Code Samples
int pageSize = 10;
client.listDeletedPaths("PathNamePrefixToMatch")
.byPage(pageSize)
.subscribe(page ->
page.getValue().forEach(path ->
System.out.printf("Name: %s%n", path.getPath())));
Parameters:
Returns:
listPaths
public PagedFlux
Returns a reactive Publisher emitting all the files/directories in this account lazily as needed. For more information, see the Azure Docs.
Code Samples
client.listPaths().subscribe(path -> System.out.printf("Name: %s%n", path.getName()));
Returns:
listPaths
public PagedFlux
Returns a reactive Publisher emitting all the files/directories in this account lazily as needed. For more information, see the Azure Docs.
Code Samples
ListPathsOptions options = new ListPathsOptions()
.setPath("PathNamePrefixToMatch")
.setMaxResults(10);
client.listPaths(options).subscribe(path -> System.out.printf("Name: %s%n", path.getName()));
Parameters:
Returns:
setAccessPolicy
public Mono
Sets the file system's permissions. The permissions indicate whether paths in a file system may be accessed publicly. Note that, for each signed identifier, we will truncate the start and expiry times to the nearest second to ensure the time formatting is compatible with the service. For more information, see the Azure Docs.
Code Samples
DataLakeSignedIdentifier identifier = new DataLakeSignedIdentifier()
.setId("name")
.setAccessPolicy(new DataLakeAccessPolicy()
.setStartsOn(OffsetDateTime.now())
.setExpiresOn(OffsetDateTime.now().plusDays(7))
.setPermissions("permissionString"));
client.setAccessPolicy(PublicAccessType.CONTAINER, Collections.singletonList(identifier)).subscribe(
response -> System.out.printf("Set access policy completed%n"),
error -> System.out.printf("Set access policy failed: %s%n", error));
Parameters:
Returns:
setAccessPolicyWithResponse
public Mono
Sets the file system's permissions. The permissions indicate whether paths in a file system may be accessed publicly. Note that, for each signed identifier, we will truncate the start and expiry times to the nearest second to ensure the time formatting is compatible with the service. For more information, see the Azure Docs.
Code Samples
DataLakeSignedIdentifier identifier = new DataLakeSignedIdentifier()
.setId("name")
.setAccessPolicy(new DataLakeAccessPolicy()
.setStartsOn(OffsetDateTime.now())
.setExpiresOn(OffsetDateTime.now().plusDays(7))
.setPermissions("permissionString"));
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId)
.setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3));
client.setAccessPolicyWithResponse(PublicAccessType.CONTAINER, Collections.singletonList(identifier), requestConditions)
.subscribe(response ->
System.out.printf("Set access policy completed with status %d%n", response.getStatusCode()));
Parameters:
Returns:
setMetadata
public Mono
Sets the file system's metadata. For more information, see the Azure Docs.
Code Samples
Map<String, String> metadata = Collections.singletonMap("metadata", "value");
client.setMetadata(metadata).subscribe(
response -> System.out.printf("Set metadata completed%n"),
error -> System.out.printf("Set metadata failed: %s%n", error));
Parameters:
Returns:
setMetadataWithResponse
public Mono
Sets the file system's metadata. For more information, see the Azure Docs.
Code Samples
Map<String, String> metadata = Collections.singletonMap("metadata", "value");
DataLakeRequestConditions requestConditions = new DataLakeRequestConditions()
.setLeaseId(leaseId)
.setIfModifiedSince(OffsetDateTime.now().minusDays(3));
client.setMetadataWithResponse(metadata, requestConditions).subscribe(response ->
System.out.printf("Set metadata completed with status %d%n", response.getStatusCode()));
Parameters:
Returns:
undeletePath
public Mono
Restores a soft deleted path in the file system. For more information see the Azure Docs.
Code Samples
client.undeletePath(deletedPath, deletionId).doOnSuccess(response -> System.out.println("Completed undelete"));
Parameters:
Returns:
undeletePathWithResponse
public Mono
Restores a soft deleted path in the file system. For more information see the Azure Docs.
Code Samples
client.undeletePathWithResponse(deletedPath, deletionId)
.doOnSuccess(response -> System.out.println("Completed undelete"));
Parameters:
Returns:
Applies to
Azure SDK for Java