WebDavSessionDownloadAsync Method
IT Hit WebDAV Classes Reference
Loads a file or a part of the content of the file from WebDAV server.
Namespace:
ITHit.WebDAV.Client
Assembly:
ITHit.WebDAV.Client (in ITHit.WebDAV.Client.dll) Version: 6.0.4052-Beta
Syntax public Task<IWebResponse> DownloadAsync(
Uri path,
long startIndex = -1,
long count = -1,
IDictionary<string, string> headers = null,
CancellationToken cancellationToken = null
)
Public Function DownloadAsync (
path As Uri,
Optional startIndex As Long = -1,
Optional count As Long = -1,
Optional headers As IDictionary(Of String, String) = Nothing,
Optional cancellationToken As CancellationToken = Nothing
) As Task(Of IWebResponse)
public:
Task<IWebResponse^>^ DownloadAsync(
Uri^ path,
long long startIndex = -1,
long long count = -1,
IDictionary<String^, String^>^ headers = nullptr,
CancellationToken cancellationToken = nullptr
)
member DownloadAsync :
path : Uri *
?startIndex : int64 *
?count : int64 *
?headers : IDictionary<string, string> *
?cancellationToken : CancellationToken
(* Defaults:
let _startIndex = defaultArg startIndex -1
let _count = defaultArg count -1
let _headers = defaultArg headers null
let _cancellationToken = defaultArg cancellationToken null
*)
-> Task<IWebResponse>
Parameters
- path
- Type: SystemUri
File path URI. - startIndex (Optional)
- Type: SystemInt64
Start position to retrieve count number of bytes from. - count (Optional)
- Type: SystemInt64
Number of bytes to retrieve. - headers (Optional)
- Type: System.Collections.GenericIDictionaryString, String
Request headers. - cancellationToken (Optional)
- Type: System.ThreadingCancellationToken
Propagates notification that operations should be canceled.
Return Value
Type:
TaskIWebResponseWebDav response to read resource content.
Exceptions Remarks
If server supports
If-Range header and last modification time do not match
(the file content was modified) the library will throw
FileContentModifiedException exception.
See Also