- createWebDAVClient(remoteURL) ⇒
Object
Create a webdav client interface
- ClientInterface :
Object
- OptionsWithHeaders :
Object
- OptionsHeadersAndFormat :
OptionsWithHeaders
Create a webdav client interface
Kind: global function
Returns: Object
- The client interface
Access: public
See: createClient
Param | Type | Description |
---|---|---|
remoteURL | String |
The target URL |
Kind: global typedef
- ClientInterface :
Object
- .createDirectory(dirPath, [options]) ⇒
Promise
- .createReadStream(remoteFilename, [options]) ⇒
Readable
- .deleteFile(remotePath, [options]) ⇒
Promise
- .getDirectoryContents(remotePath, [options]) ⇒
Promise.<Array>
- .getFileContents(remoteFilename, [options]) ⇒
Promise.<(Buffer|String)>
- .getFileStream(remoteFilename, [options]) ⇒
Promise.<Readable>
- .moveFile(remotePath, targetRemotePath, [options]) ⇒
Promise
- .putFileContents(remoteFilename, data, [options]) ⇒
Promise
- .stat(remotePath, [options]) ⇒
Promise.<Object>
- .createDirectory(dirPath, [options]) ⇒
Create a directory
Kind: static method of ClientInterface
Returns: Promise
- A promise that resolves when the remote path has been created
Param | Type | Description |
---|---|---|
dirPath | String |
The path to create |
[options] | OptionsWithHeaders |
Options for the request |
Create a readable stream of a remote file
Kind: static method of ClientInterface
Returns: Readable
- A readable stream
Param | Type | Description |
---|---|---|
remoteFilename | String |
The file to stream |
[options] | OptionsHeadersAndFormat |
Options for the request |
Delete a remote file
Kind: static method of ClientInterface
Returns: Promise
- A promise that resolves when the remote file as been deleted
Param | Type | Description |
---|---|---|
remotePath | String |
The remote path to delete |
[options] | OptionsWithHeaders |
The options for the request |
Get the contents of a remote directory
Kind: static method of ClientInterface
Returns: Promise.<Array>
- A promise that resolves with an array of remote item stats
Param | Type | Description |
---|---|---|
remotePath | String |
The path to fetch the contents of |
[options] | OptionsWithHeaders |
Options for the remote the request |
Get the contents of a remote file
Kind: static method of ClientInterface
Returns: Promise.<(Buffer|String)>
- A promise that resolves with the contents of the remote file
Param | Type | Description |
---|---|---|
remoteFilename | String |
The file to fetch |
[options] | OptionsHeadersAndFormat |
Options for the request |
Get a readable stream of a remote file
Kind: static method of ClientInterface
Returns: Promise.<Readable>
- A promise that resolves with a readable stream
Param | Type | Description |
---|---|---|
remoteFilename | String |
The file to stream |
[options] | OptionsHeadersAndFormat |
Options for the request |
Move a remote item to another path
Kind: static method of ClientInterface
Returns: Promise
- A promise that resolves once the request has completed
Param | Type | Description |
---|---|---|
remotePath | String |
The remote item path |
targetRemotePath | String |
The new path after moving |
[options] | OptionsWithHeaders |
Options for the request |
Write contents to a remote file path
Kind: static method of ClientInterface
Returns: Promise
- A promise that resolves once the contents have been written
Param | Type | Description |
---|---|---|
remoteFilename | String |
The path of the remote file |
data | String | Buffer |
The data to write |
[options] | OptionsHeadersAndFormat |
The options for the request |
Stat a remote object
Kind: static method of ClientInterface
Returns: Promise.<Object>
- A promise that resolves with the stat data
Param | Type | Description |
---|---|---|
remotePath | String |
The path of the item |
[options] | OptionsWithHeaders |
Options for the request |
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
headers | Object |
Optional headers to send with the request |
OptionsHeadersAndFormat : OptionsWithHeaders
Kind: global typedef
Properties
Name | Type | Description |
---|---|---|
format | String |
Format of request/response payload (binary/text) |