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. |
Properties
pipeline | Request policy pipeline. |
url | URL string value. |
Methods
create(Aborter, IDirectory |
Creates a new directory under the specified share or parent directory. |
delete(Aborter) | Removes the specified empty directory. Note that the directory must be empty before it can be deleted. |
force |
Force close a specific handle for a directory. |
force |
Force close all handles for a directory. |
from |
Creates a DirectoryURL object from an existing DirectoryURL. |
from |
Creates a DirectoryURL object from ShareURL. |
get |
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. |
list |
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. |
list |
Lists handles for a directory. |
new |
A static method used to create a new Pipeline object with Credential provided. |
set |
Updates user defined metadata for the specified directory. |
set |
Sets properties on the directory. |
with |
Creates a new DirectoryURL object identical to the source but with the specified request policy pipeline. |
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.
Property Details
pipeline
url
URL string value.
url: string
Property Value
string
Method Details
create(Aborter, IDirectoryCreateOptions)
Creates a new directory under the specified share or parent directory.
function create(aborter: Aborter, options?: IDirectoryCreateOptions)
Parameters
- aborter
- Aborter
Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation
- options
- IDirectoryCreateOptions
Returns
Promise<Models.DirectoryCreateResponse>
delete(Aborter)
Removes the specified empty directory. Note that the directory must be empty before it can be deleted.
function delete(aborter: Aborter)
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
Promise<Models.DirectoryDeleteResponse>
forceCloseHandle(Aborter, string)
Force close a specific handle for a directory.
function forceCloseHandle(aborter: Aborter, handleId: string)
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
Promise<Models.DirectoryForceCloseHandlesResponse>
forceCloseHandlesSegment(Aborter, undefined | string, IDirectoryForceCloseHandlesSegmentOptions)
Force close all handles for a directory.
function forceCloseHandlesSegment(aborter: Aborter, marker?: undefined | string, options?: IDirectoryForceCloseHandlesSegmentOptions)
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
-
undefined | string
Returns
Promise<Models.DirectoryForceCloseHandlesResponse>
fromDirectoryURL(DirectoryURL, string)
Creates a DirectoryURL object from an existing DirectoryURL.
static function fromDirectoryURL(directoryURL: DirectoryURL, directoryName: string)
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)
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.
function getProperties(aborter: Aborter)
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
Promise<Models.DirectoryGetPropertiesResponse>
listFilesAndDirectoriesSegment(Aborter, undefined | 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.
function listFilesAndDirectoriesSegment(aborter: Aborter, marker?: undefined | string, options?: IDirectoryListFilesAndDirectoriesSegmentOptions)
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
-
undefined | string
Returns
Promise<Models.DirectoryListFilesAndDirectoriesSegmentResponse>
listHandlesSegment(Aborter, undefined | string, IDirectoryListHandlesSegmentOptions)
Lists handles for a directory.
function listHandlesSegment(aborter: Aborter, marker?: undefined | string, options?: IDirectoryListHandlesSegmentOptions)
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
-
undefined | string
Returns
Promise<Models.DirectoryListHandlesResponse>
newPipeline(Credential, INewPipelineOptions)
A static method used to create a new Pipeline object with Credential provided.
static function newPipeline(credential: Credential, pipelineOptions?: INewPipelineOptions)
Parameters
- credential
- Credential
Such as AnonymousCredential, SharedKeyCredential.
- pipelineOptions
- INewPipelineOptions
Returns
A new Pipeline object.
setMetadata(Aborter, IMetadata)
Updates user defined metadata for the specified directory.
function setMetadata(aborter: Aborter, metadata?: IMetadata)
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
Returns
Promise<Models.DirectorySetMetadataResponse>
setProperties(Aborter, IDirectoryProperties)
Sets properties on the directory.
function setProperties(aborter: Aborter, properties?: IDirectoryProperties)
Parameters
- aborter
- Aborter
Create a new Aborter instance with Aborter.none or Aborter.timeout(), goto documents of Aborter for more examples about request cancellation
- properties
- IDirectoryProperties
Returns
Promise<Models.DirectorySetPropertiesResponse>
withPipeline(Pipeline)
Creates a new DirectoryURL object identical to the source but with the specified request policy pipeline.
function withPipeline(pipeline: Pipeline)
Parameters
- pipeline
- Pipeline
Returns
Azure SDK for JavaScript