Class DataLakeFileSystemClient

    • Field Detail

      • ROOT_FILESYSTEM_NAME

        public static final String ROOT_FILESYSTEM_NAME
        Special file system name for the root file system in the Storage account.
        See Also:
        Constant Field Values
    • Method Detail

      • getFileClient

        public DataLakeFileClient getFileClient​(String fileName)
        Initializes a new DataLakeFileClient object by concatenating fileName to the end of DataLakeFileSystemClient's URL. The new DataLakeFileClient uses the same request policy pipeline as the DataLakeFileSystemClient.
        Parameters:
        fileName - A String representing the name of the file. If the path name contains special characters, pass in the url encoded version of the path name.

        Code Samples

         DataLakeFileClient dataLakeFileClient = client.getFileClient(fileName);
         
        Returns:
        A new DataLakeFileClient object which references the file with the specified name in this file system.
      • getDirectoryClient

        public DataLakeDirectoryClient getDirectoryClient​(String directoryName)
        Initializes a new DataLakeDirectoryClient object by concatenating directoryName to the end of DataLakeFileSystemClient's URL. The new DataLakeDirectoryClient uses the same request policy pipeline as the DataLakeFileSystemClient.
        Parameters:
        directoryName - A String representing the name of the directory. If the path name contains special characters, pass in the url encoded version of the path name.

        Code Samples

         DataLakeDirectoryClient dataLakeDirectoryClient = client.getDirectoryClient(directoryName);
         
        Returns:
        A new DataLakeDirectoryClient object which references the directory with the specified name in this file system.
      • 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:
        The name of file system.
      • getAccountUrl

        public String getAccountUrl()
        Get the url of the storage account.
        Returns:
        the URL of the storage account
      • getFileSystemUrl

        public String getFileSystemUrl()
        Gets the URL of the file system represented by this client.
        Returns:
        the URL.
      • getAccountName

        public String getAccountName()
        Get associated account name.
        Returns:
        account name associated with this storage resource.
      • getServiceVersion

        public DataLakeServiceVersion getServiceVersion()
        Gets the service version the client is using.
        Returns:
        the service version the client is using.
      • getHttpPipeline

        public com.azure.core.http.HttpPipeline getHttpPipeline()
        Gets the HttpPipeline powering this client.
        Returns:
        The pipeline.
      • create

        public void create()
        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

         try {
             client.create();
             System.out.printf("Create completed%n");
         } catch (BlobStorageException error) {
             if (error.getErrorCode().equals(BlobErrorCode.CONTAINER_ALREADY_EXISTS)) {
                 System.out.printf("Can't create file system. It already exists %n");
             }
         }
         
      • createWithResponse

        public com.azure.core.http.rest.Response<Void> createWithResponse​(Map<String,​String> metadata,
                                                                          PublicAccessType accessType,
                                                                          Duration timeout,
                                                                          com.azure.core.util.Context context)
        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");
         Context context = new Context("Key", "Value");
        
         System.out.printf("Create completed with status %d%n",
             client.createWithResponse(metadata, PublicAccessType.CONTAINER, timeout, context).getStatusCode());
         
        Parameters:
        metadata - Metadata to associate with the file system. If there is leading or trailing whitespace in any metadata key or value, it must be removed or encoded.
        accessType - Specifies how the data in this file system is available to the public. See the x-ms-blob-public-access header in the Azure Docs for more information. Pass null for no public access.
        timeout - An optional timeout value beyond which a RuntimeException will be raised.
        context - Additional context that is passed through the Http pipeline during the service call.
        Returns:
        A response containing status code and HTTP headers
      • delete

        public void delete()
        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

         try {
             client.delete();
             System.out.printf("Delete completed%n");
         } catch (BlobStorageException error) {
             if (error.getErrorCode().equals(BlobErrorCode.CONTAINER_NOT_FOUND)) {
                 System.out.printf("Delete failed. File System was not found %n");
             }
         }
         
      • deleteWithResponse

        public com.azure.core.http.rest.Response<Void> deleteWithResponse​(DataLakeRequestConditions requestConditions,
                                                                          Duration timeout,
                                                                          com.azure.core.util.Context context)
        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));
         Context context = new Context("Key", "Value");
        
         System.out.printf("Delete completed with status %d%n", client.deleteWithResponse(
             requestConditions, timeout, context).getStatusCode());
         
        Parameters:
        requestConditions - DataLakeRequestConditions
        timeout - An optional timeout value beyond which a RuntimeException will be raised.
        context - Additional context that is passed through the Http pipeline during the service call.
        Returns:
        A response containing status code and HTTP headers
      • getProperties

        public FileSystemProperties getProperties()
        Returns the file system's metadata and system properties. For more information, see the Azure Docs.

        Code Samples

         FileSystemProperties properties = client.getProperties();
         System.out.printf("Public Access Type: %s, Legal Hold? %b, Immutable? %b%n",
             properties.getDataLakePublicAccess(),
             properties.hasLegalHold(),
             properties.hasImmutabilityPolicy());
         
        Returns:
        The file system properties.
      • getPropertiesWithResponse

        public com.azure.core.http.rest.Response<FileSystemProperties> getPropertiesWithResponse​(String leaseId,
                                                                                                 Duration timeout,
                                                                                                 com.azure.core.util.Context context)
        Returns the file system's metadata and system properties. For more information, see the Azure Docs.

        Code Samples

         Context context = new Context("Key", "Value");
        
         FileSystemProperties properties = client.getPropertiesWithResponse(leaseId, timeout, context)
             .getValue();
         System.out.printf("Public Access Type: %s, Legal Hold? %b, Immutable? %b%n",
             properties.getDataLakePublicAccess(),
             properties.hasLegalHold(),
             properties.hasImmutabilityPolicy());
         
        Parameters:
        leaseId - The lease ID the active lease on the file system must match.
        timeout - An optional timeout value beyond which a RuntimeException will be raised.
        context - Additional context that is passed through the Http pipeline during the service call.
        Returns:
        A response containing the file system properties.
      • setMetadata

        public void setMetadata​(Map<String,​String> metadata)
        Sets the file system's metadata. For more information, see the Azure Docs.

        Code Samples

         Map<String, String> metadata = Collections.singletonMap("metadata", "value");
         try {
             client.setMetadata(metadata);
             System.out.printf("Set metadata completed with status %n");
         } catch (UnsupportedOperationException error) {
             System.out.printf("Fail while setting metadata %n");
         }
         
        Parameters:
        metadata - Metadata to associate with the file system. If there is leading or trailing whitespace in any metadata key or value, it must be removed or encoded.
      • setMetadataWithResponse

        public com.azure.core.http.rest.Response<Void> setMetadataWithResponse​(Map<String,​String> metadata,
                                                                               DataLakeRequestConditions requestConditions,
                                                                               Duration timeout,
                                                                               com.azure.core.util.Context context)
        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)
             .setIfUnmodifiedSince(OffsetDateTime.now().minusDays(3));
         Context context = new Context("Key", "Value");
        
         System.out.printf("Set metadata completed with status %d%n",
             client.setMetadataWithResponse(metadata, requestConditions, timeout, context).getStatusCode());
         
        Parameters:
        metadata - Metadata to associate with the file system. If there is leading or trailing whitespace in any metadata key or value, it must be removed or encoded.
        requestConditions - DataLakeRequestConditions
        timeout - An optional timeout value beyond which a RuntimeException will be raised.
        context - Additional context that is passed through the Http pipeline during the service call.
        Returns:
        A response containing status code and HTTP headers
      • listPaths

        public com.azure.core.http.rest.PagedIterable<PathItem> listPaths()
        Returns a lazy loaded list of files/directories in this account. The returned PagedIterable can be consumed while new items are automatically retrieved as needed. For more information, see the Azure Docs.

        Code Samples

         client.listPaths().forEach(path -> System.out.printf("Name: %s%n", path.getName()));
         
        Returns:
        The list of files/directories.
      • listPaths

        public com.azure.core.http.rest.PagedIterable<PathItem> listPaths​(ListPathsOptions options,
                                                                          Duration timeout)
        Returns a lazy loaded list of files/directories in this account. The returned PagedIterable can be consumed while new items are automatically retrieved as needed. For more information, see the Azure Docs.

        Code Samples

         ListPathsOptions options = new ListPathsOptions()
             .setPath("pathPrefixToMatch")
             .setMaxResults(10);
        
         client.listPaths(options, timeout).forEach(path -> System.out.printf("Name: %s%n", path.getName()));
         
        Parameters:
        options - A ListPathsOptions which specifies what data should be returned by the service. If iterating by page, the page size passed to byPage methods such as ContinuablePagedIterable.iterableByPage(int) will be preferred over the value set on these options.
        timeout - An optional timeout value beyond which a RuntimeException will be raised.
        Returns:
        The list of files/directories.
      • listDeletedPaths

        public com.azure.core.http.rest.PagedIterable<PathDeletedItem> listDeletedPaths()
        Returns a lazy loaded list of files/directories recently soft deleted in this file system. The returned PagedIterable can be consumed while new items are automatically retrieved as needed. For more information, see the Azure Docs.

        Code Samples

         client.listDeletedPaths().forEach(path -> System.out.printf("Name: %s%n", path.getPath()));
         
        Returns:
        The list of files/directories.
      • listDeletedPaths

        public com.azure.core.http.rest.PagedIterable<PathDeletedItem> listDeletedPaths​(String prefix,
                                                                                        Duration timeout,
                                                                                        com.azure.core.util.Context context)
        Returns a lazy loaded list of files/directories recently soft deleted in this account. The returned PagedIterable can be consumed while new items are automatically retrieved as needed. For more information, see the Azure Docs.

        Code Samples

         Context context = new Context("Key", "Value");
         int pageSize = 10;
        
         client.listDeletedPaths("PathPrefixToMatch", timeout, context)
             .iterableByPage(pageSize)
             .forEach(page ->
                 page.getValue().forEach(path ->
                     System.out.printf("Name: %s%n", path.getPath())));
         
        Parameters:
        prefix - Specifies the path to filter the results to.
        timeout - An optional timeout value beyond which a RuntimeException will be raised.
        context - Additional context that is passed through the Http pipeline during the service call.
        Returns:
        The list of files/directories.
      • createFile

        public DataLakeFileClient createFile​(String fileName)
        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

         DataLakeFileClient fileClient = client.createFile(fileName);
         
        Parameters:
        fileName - Name of the file to create. If the path name contains special characters, pass in the url encoded version of the path name.
        Returns:
        A DataLakeFileClient used to interact with the file created.
      • createFile

        public DataLakeFileClient createFile​(String fileName,
                                             boolean overwrite)
        Creates a new file within a file system. For more information, see the Azure Docs.

        Code Samples

         boolean overwrite = false; /* Default value. */
         DataLakeFileClient fClient = client.createFile(fileName, overwrite);
         
        Parameters:
        fileName - Name of the file to create. If the path name contains special characters, pass in the url encoded version of the path name.
        overwrite - Whether or not to overwrite, should a file exist.
        Returns:
        A DataLakeFileClient used to interact with the file created.
      • createFileWithResponse

        public com.azure.core.http.rest.Response<DataLakeFileClient> createFileWithResponse​(String fileName,
                                                                                            String permissions,
                                                                                            String umask,
                                                                                            PathHttpHeaders headers,
                                                                                            Map<String,​String> metadata,
                                                                                            DataLakeRequestConditions requestConditions,
                                                                                            Duration timeout,
                                                                                            com.azure.core.util.Context context)
        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";
         Response<DataLakeFileClient> newFileClient = client.createFileWithResponse(fileName, permissions, umask, httpHeaders,
             Collections.singletonMap("metadata", "value"), requestConditions,
             timeout, new Context(key1, value1));
         
        Parameters:
        fileName - Name of the file to create. If the path name contains special characters, pass in the url encoded version of the path name.
        permissions - POSIX access permissions for the file owner, the file owning group, and others.
        umask - Restricts permissions of the file to be created.
        headers - PathHttpHeaders
        metadata - 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 - DataLakeRequestConditions
        timeout - An optional timeout value beyond which a RuntimeException will be raised.
        context - Additional context that is passed through the Http pipeline during the service call.
        Returns:
        A Response whose value contains the DataLakeFileClient used to interact with the file created.
      • deleteFile

        public void deleteFile​(String fileName)
        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);
         System.out.println("Delete request completed");
         
        Parameters:
        fileName - Name of the file to delete. If the path name contains special characters, pass in the url encoded version of the path name.
      • deleteFileWithResponse

        public com.azure.core.http.rest.Response<Void> deleteFileWithResponse​(String fileName,
                                                                              DataLakeRequestConditions requestConditions,
                                                                              Duration timeout,
                                                                              com.azure.core.util.Context context)
        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, timeout, new Context(key1, value1));
         System.out.println("Delete request completed");
         
        Parameters:
        fileName - Name of the file to delete. If the path name contains special characters, pass in the url encoded version of the path name.
        requestConditions - DataLakeRequestConditions
        timeout - An optional timeout value beyond which a RuntimeException will be raised.
        context - Additional context that is passed through the Http pipeline during the service call.
        Returns:
        A response containing status code and HTTP headers
      • createDirectory

        public DataLakeDirectoryClient createDirectory​(String directoryName)
        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

         DataLakeDirectoryClient directoryClient = client.createDirectory(directoryName);
         
        Parameters:
        directoryName - Name of the directory to create. If the path name contains special characters, pass in the url encoded version of the path name.
        Returns:
        A DataLakeDirectoryClient used to interact with the directory created.
      • createDirectory

        public DataLakeDirectoryClient createDirectory​(String directoryName,
                                                       boolean overwrite)
        Creates a new directory within a file system. For more information, see the Azure Docs.

        Code Samples

         boolean overwrite = false; /* Default value. */
         DataLakeDirectoryClient dClient = client.createDirectory(fileName, overwrite);
         
        Parameters:
        directoryName - Name of the directory to create. If the path name contains special characters, pass in the url encoded version of the path name.
        overwrite - Whether or not to overwrite, should a directory exist.
        Returns:
        A DataLakeDirectoryClient used to interact with the directory created.
      • createDirectoryWithResponse

        public com.azure.core.http.rest.Response<DataLakeDirectoryClient> createDirectoryWithResponse​(String directoryName,
                                                                                                      String permissions,
                                                                                                      String umask,
                                                                                                      PathHttpHeaders headers,
                                                                                                      Map<String,​String> metadata,
                                                                                                      DataLakeRequestConditions requestConditions,
                                                                                                      Duration timeout,
                                                                                                      com.azure.core.util.Context context)
        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";
         Response<DataLakeDirectoryClient> newDirectoryClient = client.createDirectoryWithResponse(directoryName,
             permissions, umask, httpHeaders, Collections.singletonMap("metadata", "value"), requestConditions,
             timeout, new Context(key1, value1));
         
        Parameters:
        directoryName - Name of the directory to create. If the path name contains special characters, pass in the url encoded version of the path name.
        permissions - POSIX access permissions for the directory owner, the directory owning group, and others.
        umask - Restricts permissions of the directory to be created.
        headers - PathHttpHeaders
        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
        timeout - An optional timeout value beyond which a RuntimeException will be raised.
        context - Additional context that is passed through the Http pipeline during the service call.
        Returns:
        A Response whose value contains a DataLakeDirectoryClient used to interact with the directory created.
      • deleteDirectory

        public void deleteDirectory​(String directoryName)
        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);
         System.out.println("Delete request completed");
         
        Parameters:
        directoryName - Name of the directory to delete. If the path name contains special characters, pass in the url encoded version of the path name.
      • deleteDirectoryWithResponse

        public com.azure.core.http.rest.Response<Void> deleteDirectoryWithResponse​(String directoryName,
                                                                                   boolean recursive,
                                                                                   DataLakeRequestConditions requestConditions,
                                                                                   Duration timeout,
                                                                                   com.azure.core.util.Context context)
        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, timeout,
             new Context(key1, value1));
         System.out.println("Delete request completed");
         
        Parameters:
        directoryName - Name of the directory to delete. If the path name contains special characters, pass in the url encoded version of the path name.
        recursive - Whether or not to delete all paths beneath the directory.
        requestConditions - DataLakeRequestConditions
        timeout - An optional timeout value beyond which a RuntimeException will be raised.
        context - Additional context that is passed through the Http pipeline during the service call.
        Returns:
        A response containing status code and HTTP headers
      • undeletePath

        public DataLakePathClient undeletePath​(String deletedPath,
                                               String deletionId)
        Restores a soft deleted path in the file system. For more information see the Azure Docs.

        Code Samples

         client.undeletePath(deletedPath, deletionId);
         System.out.println("Delete request completed");
         
        Parameters:
        deletedPath - The deleted path
        deletionId - deletion ID associated with the soft deleted path that uniquely identifies a resource if multiple have been soft deleted at this location. You can get soft deleted paths and their associated deletion IDs with listDeletedPaths().
        Returns:
        A client pointing to the restored resource.
        Throws:
        NullPointerException - if deletedPath or deletionId is null.
      • undeletePathWithResponse

        public com.azure.core.http.rest.Response<DataLakePathClient> undeletePathWithResponse​(String deletedPath,
                                                                                              String deletionId,
                                                                                              Duration timeout,
                                                                                              com.azure.core.util.Context context)
        Restores a soft deleted path in the file system. For more information see the Azure Docs.

        Code Samples

         client.undeletePathWithResponse(deletedPath, deletionId, timeout, new Context(key1, value1));
         System.out.println("Delete request completed");
         
        Parameters:
        deletedPath - The deleted path
        deletionId - deletion ID associated with the soft deleted path that uniquely identifies a resource if multiple have been soft deleted at this location. You can get soft deleted paths and their associated deletion IDs with listDeletedPaths().
        timeout - An optional timeout value beyond which a RuntimeException will be raised.
        context - Additional context that is passed through the Http pipeline during the service call.
        Returns:
        A response containing a client pointing to the restored resource.
        Throws:
        NullPointerException - if deletedPath or deletionId is null.
      • getAccessPolicy

        public FileSystemAccessPolicies getAccessPolicy()
        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

         FileSystemAccessPolicies accessPolicies = client.getAccessPolicy();
         System.out.printf("Data Lake Access Type: %s%n", accessPolicies.getDataLakeAccessType());
        
         for (DataLakeSignedIdentifier identifier : accessPolicies.getIdentifiers()) {
             System.out.printf("Identifier Name: %s, Permissions %s%n",
                 identifier.getId(),
                 identifier.getAccessPolicy().getPermissions());
         }
         
        Returns:
        The file system access policy.
      • getAccessPolicyWithResponse

        public com.azure.core.http.rest.Response<FileSystemAccessPolicies> getAccessPolicyWithResponse​(String leaseId,
                                                                                                       Duration timeout,
                                                                                                       com.azure.core.util.Context context)
        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

         Context context = new Context("Key", "Value");
         FileSystemAccessPolicies accessPolicies = client.getAccessPolicyWithResponse(leaseId, timeout, context)
             .getValue();
         System.out.printf("Data Lake Access Type: %s%n", accessPolicies.getDataLakeAccessType());
        
         for (DataLakeSignedIdentifier identifier : accessPolicies.getIdentifiers()) {
             System.out.printf("Identifier Name: %s, Permissions %s%n",
                 identifier.getId(),
                 identifier.getAccessPolicy().getPermissions());
         }
         
        Parameters:
        leaseId - The lease ID the active lease on the file system must match.
        timeout - An optional timeout value beyond which a RuntimeException will be raised.
        context - Additional context that is passed through the Http pipeline during the service call.
        Returns:
        The file system access policy.
      • setAccessPolicy

        public void setAccessPolicy​(PublicAccessType accessType,
                                    List<DataLakeSignedIdentifier> identifiers)
        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"));
        
         try {
             client.setAccessPolicy(PublicAccessType.CONTAINER, Collections.singletonList(identifier));
             System.out.printf("Set Access Policy completed %n");
         } catch (UnsupportedOperationException error) {
             System.out.printf("Set Access Policy completed %s%n", error);
         }
         
        Parameters:
        accessType - Specifies how the data in this file system is available to the public. See the x-ms-blob-public-access header in the Azure Docs for more information. Pass null for no public access.
        identifiers - A list of DataLakeSignedIdentifier objects that specify the permissions for the file system. Please see here for more information. Passing null will clear all access policies.
      • setAccessPolicyWithResponse

        public com.azure.core.http.rest.Response<Void> setAccessPolicyWithResponse​(PublicAccessType accessType,
                                                                                   List<DataLakeSignedIdentifier> identifiers,
                                                                                   DataLakeRequestConditions requestConditions,
                                                                                   Duration timeout,
                                                                                   com.azure.core.util.Context context)
        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));
        
         Context context = new Context("Key", "Value");
        
         System.out.printf("Set access policy completed with status %d%n",
             client.setAccessPolicyWithResponse(PublicAccessType.CONTAINER,
                 Collections.singletonList(identifier),
                 requestConditions,
                 timeout,
                 context).getStatusCode());
         
        Parameters:
        accessType - Specifies how the data in this file system is available to the public. See the x-ms-blob-public-access header in the Azure Docs for more information. Pass null for no public access.
        identifiers - A list of DataLakeSignedIdentifier objects that specify the permissions for the file system. Please see here for more information. Passing null will clear all access policies.
        requestConditions - DataLakeRequestConditions
        timeout - An optional timeout value beyond which a RuntimeException will be raised.
        context - Additional context that is passed through the Http pipeline during the service call.
        Returns:
        A response containing status code and HTTP headers
      • generateUserDelegationSas

        public String generateUserDelegationSas​(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues,
                                                UserDelegationKey userDelegationKey,
                                                String accountName,
                                                com.azure.core.util.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:
        dataLakeServiceSasSignatureValues - DataLakeServiceSasSignatureValues
        userDelegationKey - A UserDelegationKey object used to sign the SAS values. See DataLakeServiceClient.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 String representing the SAS query parameters.
      • 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:
        dataLakeServiceSasSignatureValues - DataLakeServiceSasSignatureValues
        Returns:
        A String representing the SAS query parameters.
      • generateSas

        public String generateSas​(DataLakeServiceSasSignatureValues dataLakeServiceSasSignatureValues,
                                  com.azure.core.util.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:
        dataLakeServiceSasSignatureValues - DataLakeServiceSasSignatureValues
        context - Additional context that is passed through the code when generating a SAS.
        Returns:
        A String representing the SAS query parameters.