Share via


IFileSystemOperations.UploadFolder Method

Definition

Uploads a folder to the specified Data Lake Store account.

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

Parameters

accountName
String

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

sourcePath
String

The local source folder to upload to the Data Lake Store account.

destinationPath
String

The Data Lake Store path (starting with '/') of the directory to upload to.

perFileThreadCount
Int32

The maximum number of threads to use per file during the upload. By default, this number will be computed based on folder structure and average file size.

concurrentFileCount
Int32

The maximum number of files to upload at once. By default, this number will be computed based on folder structure and number of files.

resume
Boolean

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

overwrite
Boolean

A switch indicating this upload should overwrite the contents of the target directory if it exists. Default is false, and the upload will fast fail if the target location exists.

uploadAsBinary
Boolean

A switch indicating this upload should treat all data as binary, which is slightly more performant but does not ensure record boundary integrity. This is recommended for large folders of mixed binary and text files or binary only directories. Default is false

recurse
Boolean

A switch indicating this upload should upload the source directory recursively or just the top level. Default is false, only the top level will be uploaded.

progressTracker
IProgress<TransferFolderProgress>

An optional delegate that can be used to track the progress of the upload 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 upload is attempted or a file/folder 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