DirectoryURL class

A DirectoryURL represents a URL to the Azure Storage directory allowing you to manipulate its files and directories.

Extends

Constructors

DirectoryURL(string, Pipeline)

Creates an instance of DirectoryURL.

Inherited Properties

url

URL string value.

Methods

create(Aborter, IDirectoryCreateOptions)

Creates a new directory under the specified share or parent directory.

See https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory

delete(Aborter)

Removes the specified empty directory. Note that the directory must be empty before it can be deleted.

See https://docs.microsoft.com/en-us/rest/api/storageservices/delete-directory

forceCloseHandle(Aborter, string)

Force close a specific handle for a directory.

See https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles

forceCloseHandlesSegment(Aborter, string, IDirectoryForceCloseHandlesSegmentOptions)

Force close all handles for a directory.

See https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles

fromDirectoryURL(DirectoryURL, string)

Creates a DirectoryURL object from an existing DirectoryURL.

fromShareURL(ShareURL, string)

Creates a DirectoryURL object from ShareURL.

getProperties(Aborter)

Returns all system properties for the specified directory, and can also be used to check the existence of a directory. The data returned does not include the files in the directory or any subdirectories.

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-directory-properties

listFilesAndDirectoriesSegment(Aborter, string, IDirectoryListFilesAndDirectoriesSegmentOptions)

Returns a list of files or directories under the specified share or directory. It lists the contents only for a single level of the directory hierarchy.

See https://docs.microsoft.com/en-us/rest/api/storageservices/list-directories-and-files

listHandlesSegment(Aborter, string, IDirectoryListHandlesSegmentOptions)

Lists handles for a directory.

See https://docs.microsoft.com/en-us/rest/api/storageservices/list-handles

setMetadata(Aborter, IMetadata)

Updates user defined metadata for the specified directory.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-directory-metadata

setProperties(Aborter, IDirectoryProperties)

Sets properties on the directory.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-directory-properties

withPipeline(Pipeline)

Creates a new DirectoryURL object identical to the source but with the specified request policy pipeline.

Inherited Methods

newPipeline(Credential, INewPipelineOptions)

A static method used to create a new Pipeline object with Credential provided.

Constructor Details

DirectoryURL(string, Pipeline)

Creates an instance of DirectoryURL.

new DirectoryURL(url: string, pipeline: Pipeline)

Parameters

url

string

A URL string pointing to Azure Storage file directory, such as "https://myaccount.file.core.windows.net/myshare/mydirectory". You can append a SAS if using AnonymousCredential, such as "https://myaccount.file.core.windows.net/myshare/mydirectory?sasString". This method accepts an encoded URL or non-encoded URL pointing to a directory. Encoded URL string will NOT be escaped twice, only special characters in URL path will be escaped. However, if a directory name includes %, directory name must be encoded in the URL. Such as a directory named "mydir%", the URL should be "https://myaccount.file.core.windows.net/myshare/mydir%25".

pipeline
Pipeline

Call StorageURL.newPipeline() to create a default pipeline, or provide a customized pipeline.

Inherited Property Details

url

URL string value.

url: string

Property Value

string

Inherited From StorageURL.url

Method Details

create(Aborter, IDirectoryCreateOptions)

Creates a new directory under the specified share or parent directory.

See https://docs.microsoft.com/en-us/rest/api/storageservices/create-directory

function create(aborter: Aborter, options?: IDirectoryCreateOptions): Promise<DirectoryCreateResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

delete(Aborter)

Removes the specified empty directory. Note that the directory must be empty before it can be deleted.

See https://docs.microsoft.com/en-us/rest/api/storageservices/delete-directory

function delete(aborter: Aborter): Promise<DirectoryDeleteResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

forceCloseHandle(Aborter, string)

Force close a specific handle for a directory.

See https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles

function forceCloseHandle(aborter: Aborter, handleId: string): Promise<DirectoryForceCloseHandlesResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

handleId

string

Specific handle ID, cannot be asterisk "*". Use forceCloseHandlesSegment() to close all handles.

Returns

forceCloseHandlesSegment(Aborter, string, IDirectoryForceCloseHandlesSegmentOptions)

Force close all handles for a directory.

See https://docs.microsoft.com/en-us/rest/api/storageservices/force-close-handles

function forceCloseHandlesSegment(aborter: Aborter, marker?: string, options?: IDirectoryForceCloseHandlesSegmentOptions): Promise<DirectoryForceCloseHandlesResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

marker

string

Optional. A string value that identifies the position of handles that will be closed with the next force close handles operation. The operation returns a marker value within the response body if there are more handles to close. The marker value may then be used in a subsequent call to close the next set of handles.

Returns

fromDirectoryURL(DirectoryURL, string)

Creates a DirectoryURL object from an existing DirectoryURL.

static function fromDirectoryURL(directoryURL: DirectoryURL, directoryName: string): DirectoryURL

Parameters

directoryURL
DirectoryURL

A DirectoryURL object

directoryName

string

A subdirectory name

Returns

fromShareURL(ShareURL, string)

Creates a DirectoryURL object from ShareURL.

static function fromShareURL(shareURL: ShareURL, directoryName: string): DirectoryURL

Parameters

shareURL
ShareURL

A ShareURL object

directoryName

string

A directory name

Returns

getProperties(Aborter)

Returns all system properties for the specified directory, and can also be used to check the existence of a directory. The data returned does not include the files in the directory or any subdirectories.

See https://docs.microsoft.com/en-us/rest/api/storageservices/get-directory-properties

function getProperties(aborter: Aborter): Promise<DirectoryGetPropertiesResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

listFilesAndDirectoriesSegment(Aborter, string, IDirectoryListFilesAndDirectoriesSegmentOptions)

Returns a list of files or directories under the specified share or directory. It lists the contents only for a single level of the directory hierarchy.

See https://docs.microsoft.com/en-us/rest/api/storageservices/list-directories-and-files

function listFilesAndDirectoriesSegment(aborter: Aborter, marker?: string, options?: IDirectoryListFilesAndDirectoriesSegmentOptions): Promise<DirectoryListFilesAndDirectoriesSegmentResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

marker

string

Returns

listHandlesSegment(Aborter, string, IDirectoryListHandlesSegmentOptions)

Lists handles for a directory.

See https://docs.microsoft.com/en-us/rest/api/storageservices/list-handles

function listHandlesSegment(aborter: Aborter, marker?: string, options?: IDirectoryListHandlesSegmentOptions): Promise<DirectoryListHandlesResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

marker

string

Optional. A string value that identifies the portion of the list to be returned with the next list handles operation. The operation returns a marker value within the response body if the list returned was not complete. The marker value may then be used in a subsequent call to request the next set of list items.

Returns

setMetadata(Aborter, IMetadata)

Updates user defined metadata for the specified directory.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-directory-metadata

function setMetadata(aborter: Aborter, metadata?: IMetadata): Promise<DirectorySetMetadataResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

metadata

IMetadata

If no metadata provided, all existing directory metadata will be removed

Returns

setProperties(Aborter, IDirectoryProperties)

Sets properties on the directory.

See https://docs.microsoft.com/en-us/rest/api/storageservices/set-directory-properties

function setProperties(aborter: Aborter, properties?: IDirectoryProperties): Promise<DirectorySetPropertiesResponse>

Parameters

aborter
Aborter

Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation

Returns

withPipeline(Pipeline)

Creates a new DirectoryURL object identical to the source but with the specified request policy pipeline.

function withPipeline(pipeline: Pipeline): DirectoryURL

Parameters

pipeline
Pipeline

Returns

Inherited Method Details

newPipeline(Credential, INewPipelineOptions)

A static method used to create a new Pipeline object with Credential provided.

static function newPipeline(credential: Credential, pipelineOptions?: INewPipelineOptions): Pipeline

Parameters

credential
Credential

Such as AnonymousCredential, SharedKeyCredential.

pipelineOptions
INewPipelineOptions

Optional. Options.

Returns

A new Pipeline object.

Inherited From StorageURL.newPipeline