Options
All
  • Public
  • Public/Protected
  • All
Menu

Class DataLakeFileSystemClient

Package version

A DataLakeFileSystemClient represents a URL to the Azure Storage file system allowing you to manipulate its directories and files.

Hierarchy

Index

Constructors

constructor

Properties

accountName

accountName: string

Protected blobEndpointUrl

blobEndpointUrl: string

Encoded URL string value for corresponding blob endpoint.

credential

credential: StorageSharedKeyCredential | AnonymousCredential | TokenCredential

Such as AnonymousCredential, StorageSharedKeyCredential or any credential from the @azure/identity package to authenticate requests to the service. You can also provide an object that implements the TokenCredential interface. If not specified, AnonymousCredential is used.

Protected dfsEndpointUrl

dfsEndpointUrl: string

Encoded URL string value for corresponding dfs endpoint.

Protected isHttps

isHttps: boolean

Protected storageClientContext

storageClientContext: StorageClientContext

StorageClient is a reference to protocol layer operations entry, which is generated by AutoRest generator.

Protected storageClientContextToBlobEndpoint

storageClientContextToBlobEndpoint: StorageClientContext

storageClientContextWithBlobEndpoint is a reference to protocol layer operations entry, which is generated by AutoRest generator, with its url pointing to the Blob endpoint.

url

url: string

Encoded URL string value.

Accessors

name

  • get name(): string

Methods

create

createIfNotExists

delete

deleteIfExists

exists

generateSasUrl

getAccessPolicy

getDataLakeLeaseClient

getDirectoryClient

getFileClient

getProperties

listDeletedPaths

  • Returns an async iterable iterator to list all the paths (directories and files) under the specified file system.

    .byPage() returns an async iterable iterator to list the paths in pages.

    Example using for await syntax:

    // Get the fileSystemClient before you run these snippets,
    // Can be obtained from `serviceClient.getFileSystemClient("<your-filesystem-name>");`
    let i = 1;
    for await (const deletePath of fileSystemClient.listDeletedPaths()) {
      console.log(`Path ${i++}: ${deletePath.name}`);
    }

    Example using iter.next():

    let i = 1;
    let iter = fileSystemClient.listDeletedPaths();
    let deletedPathItem = await iter.next();
    while (!deletedPathItem.done) {
      console.log(`Path ${i++}: ${deletedPathItem.value.name}`);
      pathItem = await iter.next();
    }

    Example using byPage():

    // passing optional maxPageSize in the page settings
    let i = 1;
    for await (const response of fileSystemClient.listDeletedPaths().byPage({ maxPageSize: 20 })) {
      for (const deletePath of response.pathItems) {
        console.log(`Path ${i++}: ${deletePath.name}`);
      }
    }

    Example using paging with a marker:

    let i = 1;
    let iterator = fileSystemClient.listDeletedPaths().byPage({ maxPageSize: 2 });
    let response = (await iterator.next()).value;
    
    // Prints 2 path names
    for (const path of response.pathItems) {
      console.log(`Path ${i++}: ${path.name}}`);
    }
    
    // Gets next marker
    let marker = response.continuationToken;
    
    // Passing next marker as continuationToken
    
    iterator = fileSystemClient.listDeletedPaths().byPage({ continuationToken: marker, maxPageSize: 10 });
    response = (await iterator.next()).value;
    
    // Prints 10 path names
    for (const deletePath of response.deletedPathItems) {
      console.log(`Path ${i++}: ${deletePath.name}`);
    }
    see

    https://docs.microsoft.com/rest/api/storageservices/list-blobs

    Parameters

    Returns PagedAsyncIterableIterator<DeletedPath, FileSystemListDeletedPathsResponse>

listPaths

  • Returns an async iterable iterator to list all the paths (directories and files) under the specified file system.

    .byPage() returns an async iterable iterator to list the paths in pages.

    Example using for await syntax:

    // Get the fileSystemClient before you run these snippets,
    // Can be obtained from `serviceClient.getFileSystemClient("<your-filesystem-name>");`
    let i = 1;
    for await (const path of fileSystemClient.listPaths()) {
      console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);
    }

    Example using iter.next():

    let i = 1;
    let iter = fileSystemClient.listPaths();
    let pathItem = await iter.next();
    while (!pathItem.done) {
      console.log(`Path ${i++}: ${pathItem.value.name}, isDirectory?: ${pathItem.value.isDirectory}`);
      pathItem = await iter.next();
    }

    Example using byPage():

    // passing optional maxPageSize in the page settings
    let i = 1;
    for await (const response of fileSystemClient.listPaths().byPage({ maxPageSize: 20 })) {
      for (const path of response.pathItems) {
        console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);
      }
    }

    Example using paging with a marker:

    let i = 1;
    let iterator = fileSystemClient.listPaths().byPage({ maxPageSize: 2 });
    let response = (await iterator.next()).value;
    
    // Prints 2 path names
    for (const path of response.pathItems) {
      console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);
    }
    
    // Gets next marker
    let marker = response.continuationToken;
    
    // Passing next marker as continuationToken
    
    iterator = fileSystemClient.listPaths().byPage({ continuationToken: marker, maxPageSize: 10 });
    response = (await iterator.next()).value;
    
    // Prints 10 path names
    for (const path of response.pathItems) {
      console.log(`Path ${i++}: ${path.name}, isDirectory?: ${path.isDirectory}`);
    }
    see

    https://docs.microsoft.com/rest/api/storageservices/list-blobs

    Parameters

    • Default value options: ListPathsOptions = {}

      Optional. Options when listing paths.

    Returns PagedAsyncIterableIterator<Path, FileSystemListPathsResponse>

setAccessPolicy

setMetadata

undeletePath

Generated using TypeDoc