共用方式為


IFileSystemOperations.DownloadFile Method

Definition

Downloads a file from the specified Data Lake Store account.

public void DownloadFile (string accountName, string sourcePath, string destinationPath, int threadCount = -1, bool resume = false, bool overwrite = false, IProgress<Microsoft.Azure.Management.DataLake.Store.TransferProgress> progressTracker = default, System.Threading.CancellationToken cancellationToken = default);
abstract member DownloadFile : string * string * string * int * bool * bool * IProgress<Microsoft.Azure.Management.DataLake.Store.TransferProgress> * System.Threading.CancellationToken -> unit
Public Sub DownloadFile (accountName As String, sourcePath As String, destinationPath As String, Optional threadCount As Integer = -1, Optional resume As Boolean = false, Optional overwrite As Boolean = false, Optional progressTracker As IProgress(Of TransferProgress) = Nothing, Optional cancellationToken As CancellationToken = Nothing)

Parameters

accountName
String

The Azure Data Lake Store account to execute filesystem operations on.

sourcePath
String

The Data Lake Store path (starting with '/') of the file to download.

destinationPath
String

The local path to download the file to. If a directory is specified, the file name will be the same as the source file name

threadCount
Int32

The maximum number of threads to use during the download. By default, this number will be computed based on file size.

resume
Boolean

A switch indicating if this download is a continuation of a previous, failed download. Default is false.

overwrite
Boolean

A switch indicating this download should overwrite the the target file if it exists. Default is false, and the download will fast fail if the target file exists.

progressTracker
IProgress<TransferProgress>

An optional delegate that can be used to track the progress of the download operation asynchronously.

cancellationToken
CancellationToken

The cancellation token.

Exceptions

Thrown when the operation returned an invalid status code.

Thrown when the operation takes too long to complete or if the user explicitly cancels it.

Thrown when resume metadata is corrupt or not associated with the current operation.

Thrown when the source path cannot be found.

Thrown if an invalid download is attempted or a file is modified externally during the operation.

Microsoft.Azure.Management.DataLake.Store.TransferFailedException

Thrown if the transfer operation fails.

Thrown when unable to deserialize the response

Thrown when a required parameter is null

Applies to