Azure.Storage.Files.DataLake.DataLakeFileSystemClient
The DataLakeFileSystemClient allows you to manipulate Azure
Data Lake file systems and their directories and files.
Gets the Storage account name corresponding to the share client.
Indicates whether the client is able to generate a SAS uri.
Client can generate a SAS url if it is authenticated with a StorageSharedKeyCredential.
Gets the name of the file system.
Gets the file systems's primary Uri endpoint.
protected DataLakeFileSystemClient()
Initializes a new instance of the DataLakeFileSystemClient
class for mocking.
Initializes a new instance of the DataLakeFileSystemClient
class.
Initializes a new instance of the DataLakeFileSystemClient
class.
Initializes a new instance of the DataLakeFileSystemClient
class.
public DataLakeFileSystemClient(string connectionString, string fileSystemName, DataLakeClientOptions options)
Initializes a new instance of the DataLakeFileSystemClient
class.
Initializes a new instance of the DataLakeFileSystemClient
class.
public DataLakeFileSystemClient(Uri fileSystemUri, StorageSharedKeyCredential credential, DataLakeClientOptions options)
Initializes a new instance of the DataLakeFileSystemClient
class.
Initializes a new instance of the DataLakeFileSystemClient
class.
public DataLakeFileSystemClient(Uri fileSystemUri, AzureSasCredential credential, DataLakeClientOptions options)
Initializes a new instance of the DataLakeFileSystemClient
class.
Initializes a new instance of the DataLakeFileSystemClient
class.
public DataLakeFileSystemClient(Uri fileSystemUri, TokenCredential credential, DataLakeClientOptions options)
Initializes a new instance of the DataLakeFileSystemClient
class.
public virtual Response<FileSystemInfo> Create(DataLakeFileSystemCreateOptions options = null, CancellationToken cancellationToken = default)
The Create
operation creates a new file system under the specified account. If the file system with the same name
already exists, the operation fails.
For more information, see
Create Container.
public virtual Response<FileSystemInfo> Create(PublicAccessType publicAccessType, IDictionary<string, string> metadata, CancellationToken cancellationToken)
The Create
operation creates a new file system under the specified account. If the file system with the same name
already exists, the operation fails.
For more information, see
Create Container.
public virtual Task<Response<FileSystemInfo>> CreateAsync(DataLakeFileSystemCreateOptions options = null, CancellationToken cancellationToken = default)
The CreateAsync
operation creates a new file system
under the specified account. If the file system with the same name
already exists, the operation fails.
For more information, see
Create Container.
public virtual Task<Response<FileSystemInfo>> CreateAsync(PublicAccessType publicAccessType, IDictionary<string, string> metadata, CancellationToken cancellationToken)
The CreateAsync
operation creates a new file system under the specified account. If the file system with the same name
already exists, the operation fails.
For more information, see
Create Container.
public virtual Response<DataLakeDirectoryClient> CreateDirectory(string path, DataLakePathCreateOptions options = null, CancellationToken cancellationToken = default)
The CreateDirectory
operation creates a directory in this file system.
If the directory already exists, it will be overwritten. If you don't intent to overwrite
an existing directory, consider using the CreateIfNotExists API.
For more information, see https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create.
public virtual Response<DataLakeDirectoryClient> CreateDirectory(string path, PathHttpHeaders httpHeaders, IDictionary<string, string> metadata, string permissions, string umask, DataLakeRequestConditions conditions, CancellationToken cancellationToken)
The CreateDirectory
operation creates a directory in this file system.
If the directory already exists, it will be overwritten. If you don't intent to overwrite
an existing directory, consider using the CreateIfNotExists API.
For more information, see https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create.
public virtual Task<Response<DataLakeDirectoryClient>> CreateDirectoryAsync(string path, DataLakePathCreateOptions options = null, CancellationToken cancellationToken = default)
The CreateDirectoryAsync
operation creates a directory in this file system.
If the directory already exists, it will be overwritten. If you don't intent to overwrite
an existing directory, consider using the CreateIfNotExistsAsync API.
For more information, see https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create.
public virtual Task<Response<DataLakeDirectoryClient>> CreateDirectoryAsync(string path, PathHttpHeaders httpHeaders, IDictionary<string, string> metadata, string permissions, string umask, DataLakeRequestConditions conditions, CancellationToken cancellationToken)
The CreateDirectoryAsync
operation creates a directory in this file system.
If the directory already exists, it will be overwritten. If you don't intent to overwrite
an existing directory, consider using the CreateIfNotExistsAsync API.
For more information, see https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create.
public virtual Response<DataLakeFileClient> CreateFile(string path, DataLakePathCreateOptions options = null, CancellationToken cancellationToken = default)
The CreateFile operation creates a file in this file system.
If the file already exists, it will be overwritten. If you don't intent to overwrite
an existing file, consider using the CreateIfNotExists API.
For more information, see https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create.
public virtual Response<DataLakeFileClient> CreateFile(string path, PathHttpHeaders httpHeaders, IDictionary<string, string> metadata, string permissions, string umask, DataLakeRequestConditions conditions, CancellationToken cancellationToken)
The CreateFile
operation creates a file in this file system.
If the file already exists, it will be overwritten. If you don't intent to overwrite
an existing file, consider using the CreateIfNotExists API.
For more information, see https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create.
public virtual Task<Response<DataLakeFileClient>> CreateFileAsync(string path, DataLakePathCreateOptions options = null, CancellationToken cancellationToken = default)
The CreateFileAsync creates a file in this file system.
If the file already exists, it will be overwritten. If you don't intent to overwrite
an existing file, consider using the CreateIfNotExistsAsync API.
For more information, see https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create.
public virtual Task<Response<DataLakeFileClient>> CreateFileAsync(string path, PathHttpHeaders httpHeaders, IDictionary<string, string> metadata, string permissions, string umask, DataLakeRequestConditions conditions, CancellationToken cancellationToken)
The CreateFileAsync
creates a file in this file system.
If the file already exists, it will be overwritten. If you don't intent to overwrite
an existing file, consider using the CreateIfNotExistsAsync API.
For more information, see https://docs.microsoft.com/en-us/rest/api/storageservices/datalakestoragegen2/path/create.
public virtual Response<FileSystemInfo> CreateIfNotExists(DataLakeFileSystemCreateOptions options = null, CancellationToken cancellationToken = default)
The CreateIfNotExistsAsync
operation creates a new file system
under the specified account. If the file system with the same name
already exists, the operation fails.
For more information, see
Create Container.
public virtual Response<FileSystemInfo> CreateIfNotExists(PublicAccessType publicAccessType, IDictionary<string, string> metadata, CancellationToken cancellationToken)
The CreateIfNotExists
operation creates a new file system under the specified account. If the file system with the same name
already exists, the operation fails.
For more information, see
Create Container.
public virtual Task<Response<FileSystemInfo>> CreateIfNotExistsAsync(DataLakeFileSystemCreateOptions options = null, CancellationToken cancellationToken = default)
The CreateIfNotExistsAsync
operation creates a new file system
under the specified account. If the file system with the same name
already exists, the operation fails.
For more information, see
Create Container.
public virtual Task<Response<FileSystemInfo>> CreateIfNotExistsAsync(PublicAccessType publicAccessType, IDictionary<string, string> metadata, CancellationToken cancellationToken)
The CreateIfNotExistsAsync
operation creates a new file system under the specified account. If the file system with the same name
already exists, the operation fails.
For more information, see
Create Container.
public virtual Response Delete(DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The Delete operation marks the specified
file system for deletion.
For more information, see
Delete Container.
public virtual Task<Response> DeleteAsync(DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The DeleteAsync operation marks the specified
file system for deletion.
For more information, see
Delete Container.
public virtual Response DeleteDirectory(string path, DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The DeleteDirectory operation marks the specified path
deletion.
For more information, see
Delete Path.
public virtual Task<Response> DeleteDirectoryAsync(string path, DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The DeleteDirectoryAsync deletes a directory in this file system.
For more information, see
Delete Path.
public virtual Response DeleteFile(string path, DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The DeleteFile deletes a file in this file system.
For more information, see
Delete Path.
public virtual Task<Response> DeleteFileAsync(string path, DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The DeleteFileAsync deletes a file in this file system.
For more information, see
Delete Path.
public virtual Response<bool> DeleteIfExists(DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The DeleteIfExists operation marks the specified
file system for deletion if it exists.
For more information, see
Delete Container.
public virtual Task<Response<bool>> DeleteIfExistsAsync(DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The DeleteIfExistsAsync operation marks the specified
file system for deletion if it exists.
For more information, see
Delete Container.
The Exists operation can be called on a
DataLakeFileClient to see if the associated
file system exists on the storage account in the storage service.
The ExistsAsync operation can be called on a
DataLakeFileSystemClient to see if the associated
file system exists on the storage account in the storage service.
public virtual Uri GenerateSasUri(DataLakeFileSystemSasPermissions permissions, DateTimeOffset expiresOn)
The GenerateSasUri
returns a Uri that generates a DataLake FileSystem Service
Shared Access Signature (SAS) Uri based on the BlobContainerClient
properties and parameters passed. The SAS is signed by the shared key credential
of the client.
To check if the client is able to sign a Service Sas see
CanGenerateSasUri.
For more information, see
Constructing a service SAS.
public virtual Uri GenerateSasUri(DataLakeFileSystemSasPermissions permissions, DateTimeOffset expiresOn, out string stringToSign)
The GenerateSasUri
returns a Uri that generates a DataLake FileSystem Service
Shared Access Signature (SAS) Uri based on the BlobContainerClient
properties and parameters passed. The SAS is signed by the shared key credential
of the client.
To check if the client is able to sign a Service Sas see
CanGenerateSasUri.
For more information, see
Constructing a service SAS.
The GenerateSasUri returns a Uri
that generates a DataLake FileSystem Service Shared Access Signature (SAS)
Uri based on the Client properties and builder passed.
The SAS is signed by the shared key credential of the client.
To check if the client is able to sign a Service Sas see
CanGenerateSasUri.
For more information, see
Constructing a Service SAS.
The GenerateSasUri returns a Uri
that generates a DataLake FileSystem Service Shared Access Signature (SAS)
Uri based on the Client properties and builder passed.
The SAS is signed by the shared key credential of the client.
To check if the client is able to sign a Service Sas see
CanGenerateSasUri.
For more information, see
Constructing a Service SAS.
public virtual Uri GenerateUserDelegationSasUri(DataLakeFileSystemSasPermissions permissions, DateTimeOffset expiresOn, UserDelegationKey userDelegationKey)
The GenerateUserDelegationSasUri
returns a Uri that generates a DataLake FileSystem Service
Shared Access Signature (SAS) Uri based on the Client properties and parameters passed.
The SAS is signed by the user delegation key passed in.
For more information, see
Creating an user delegation SAS.
public virtual Uri GenerateUserDelegationSasUri(DataLakeFileSystemSasPermissions permissions, DateTimeOffset expiresOn, UserDelegationKey userDelegationKey, out string stringToSign)
The GenerateUserDelegationSasUri
returns a Uri that generates a DataLake FileSystem Service
Shared Access Signature (SAS) Uri based on the Client properties and parameters passed.
The SAS is signed by the user delegation key passed in.
For more information, see
Creating an user delegation SAS.
public virtual Uri GenerateUserDelegationSasUri(DataLakeSasBuilder builder, UserDelegationKey userDelegationKey)
The GenerateUserDelegationSasUri returns a Uri
that generates a DataLake FileSystem Service Shared Access Signature (SAS)
Uri based on the Client properties and builder passed.
The SAS is signed by the user delegation key passed in.
For more information, see
Creating an user delegation SAS.
public virtual Uri GenerateUserDelegationSasUri(DataLakeSasBuilder builder, UserDelegationKey userDelegationKey, out string stringToSign)
The GenerateUserDelegationSasUri returns a Uri
that generates a DataLake FileSystem Service Shared Access Signature (SAS)
Uri based on the Client properties and builder passed.
The SAS is signed by the user delegation key passed in.
For more information, see
Creating an user delegation SAS.
public virtual Response<FileSystemAccessPolicy> GetAccessPolicy(DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The GetAccessPolicy operation gets the
permissions for this file system. The permissions indicate whether
file system data may be accessed publicly.
For more information, see
Get Container ACL.
public virtual Task<Response<FileSystemAccessPolicy>> GetAccessPolicyAsync(DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The GetAccessPolicyAsync operation gets the
permissions for this file system. The permissions indicate whether
file system data may be accessed publicly.
For more information, see
Get Container ACL.
public virtual Pageable<PathDeletedItem> GetDeletedPaths(string pathPrefix = null, CancellationToken cancellationToken = default)
Gets the paths that have recently been soft deleted in this file system.
public virtual AsyncPageable<PathDeletedItem> GetDeletedPathsAsync(string pathPrefix = null, CancellationToken cancellationToken = default)
Gets the paths that have recently been soft deleted in this file system.
Create a new DataLakeDirectoryClient object by appending
directoryName to the end of Uri. The
new DataLakeDirectoryClient uses the same request policy
pipeline as the DataLakeFileSystemClient.
Create a new DataLakeFileClient object by appending
fileName to the end of Uri. The
new DataLakeFileClient uses the same request policy
pipeline as the DataLakeFileClient.
public virtual Pageable<PathItem> GetPaths(DataLakeGetPathsOptions options = null, CancellationToken cancellationToken = default)
The GetPathsAsync
operation returns an async sequence of paths in this file system.
Enumerating the paths may make multiple requests to the service
while fetching all the values.
For more information, see
List Path(s).
public virtual Pageable<PathItem> GetPaths(string path, bool recursive, bool userPrincipalName, CancellationToken cancellationToken)
The GetPaths
operation returns an async sequence of paths in this file system.
Enumerating the paths may make multiple requests to the service
while fetching all the values.
For more information, see
List Path(s).
public virtual AsyncPageable<PathItem> GetPathsAsync(DataLakeGetPathsOptions options = null, CancellationToken cancellationToken = default)
The GetPathsAsync
operation returns an async sequence of paths in this file system. Enumerating
the paths may make multiple requests to the service while fetching all the
values.
For more information, see
List Path(s).
public virtual AsyncPageable<PathItem> GetPathsAsync(string path, bool recursive, bool userPrincipalName, CancellationToken cancellationToken)
The GetPathsAsync
operation returns an async sequence of paths in this file system. Enumerating
the paths may make multiple requests to the service while fetching all the
values.
For more information, see
List Path(s).
public virtual Response<FileSystemProperties> GetProperties(DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The GetProperties operation returns all
user-defined metadata and system properties for the specified
file system. The data returned does not include the file system's
list of paths.
For more information, see
Get Container Properties.
public virtual Task<Response<FileSystemProperties>> GetPropertiesAsync(DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The GetPropertiesAsync operation returns all
user-defined metadata and system properties for the specified
file system. The data returned does not include the file system's
list of paths.
For more information, see
Get Container Properties.
public virtual Response<FileSystemInfo> SetAccessPolicy(PublicAccessType accessType = 0, IEnumerable<DataLakeSignedIdentifier> permissions = null, DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The SetAccessPolicy operation sets the
permissions for the specified file system. The permissions indicate
whether file system data may be accessed publicly.
For more information, see
Set Container ACL.
public virtual Task<Response<FileSystemInfo>> SetAccessPolicyAsync(PublicAccessType accessType = 0, IEnumerable<DataLakeSignedIdentifier> permissions = null, DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The SetAccessPolicyAsync operation sets the
permissions for the specified file system. The permissions indicate
whether the file system data may be accessed publicly.
For more information, see
Set Container ACL.
public virtual Response<FileSystemInfo> SetMetadata(IDictionary<string, string> metadata, DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The SetMetadata operation sets one or more
user-defined name-value pairs for the specified file system.
For more information, see
Set Container Metadata.
public virtual Task<Response<FileSystemInfo>> SetMetadataAsync(IDictionary<string, string> metadata, DataLakeRequestConditions conditions = null, CancellationToken cancellationToken = default)
The SetMetadataAsync operation sets one or more
user-defined name-value pairs for the specified file system.
For more information, see
Set Container Metadata.
public virtual Response<DataLakePathClient> UndeletePath(string deletedPath, string deletionId, CancellationToken cancellationToken = default)
Restores a soft deleted path.
public virtual Task<Response<DataLakePathClient>> UndeletePathAsync(string deletedPath, string deletionId, CancellationToken cancellationToken = default)
Restores a soft deleted path.