Show / Hide Table of Contents

Class BlobStorageFileTransferService

Implements the IFileTransferService contract, supporting transfer of files to/from Azure BLOB storage

Inheritance
System.Object
BlobStorageFileTransferService
Implements
IFileTransferService
Namespace: DNVGL.One.Compute.StorageLibrary.Azure.FileTransfer
Assembly: DNVGL.One.Compute.StorageLibrary.Azure.dll
Syntax
public class BlobStorageFileTransferService : object, IFileTransferService

Constructors

View Source

BlobStorageFileTransferService()

Initializes a new instance of the BlobStorageFileTransferService class.

Declaration
public BlobStorageFileTransferService()

Properties

View Source

InitialRequestRetryIntervalSeconds

Gets or sets the initial retry interval in seconds.

Declaration
public int InitialRequestRetryIntervalSeconds { get; set; }
Property Value
Type Description
System.Int32

The initial retry interval in seconds.

View Source

MaxNumberOfRequestRetries

Gets or sets the maximum number of request retries.

Declaration
public int MaxNumberOfRequestRetries { get; set; }
Property Value
Type Description
System.Int32

The maximum number of retries.

View Source

MaxNumberOfUploadRetries

Gets or sets the maximum number of upload retries.

Declaration
public int MaxNumberOfUploadRetries { get; set; }
Property Value
Type Description
System.Int32

The maximum number of upload retries.

View Source

NumberOfUploadTasksPerCore

Gets or sets the number of upload tasks per core.

Declaration
public int NumberOfUploadTasksPerCore { get; set; }
Property Value
Type Description
System.Int32

The number of upload tasks per core.

View Source

ShouldOverwrite

Gets or sets a callback to control when a destination file should be overwritten. Default is to always overwrite.

Declaration
public Func<object, object, bool> ShouldOverwrite { get; set; }
Property Value
Type Description
Func<System.Object, System.Object, System.Boolean>

The callback to determine whether a file should be overwritten.

Methods

View Source

DownloadFilesAsync(IEnumerable<FileTransferSpecification>)

Downloads the specified files asynchronously. The SourceSpecification must be of type BlobDirectorySpecification, while DestinationSpecification must be of type FileSystemDirectorySpecification.

Declaration
public Task<IEnumerable<FileTransferResult>> DownloadFilesAsync(IEnumerable<FileTransferSpecification> fileTransferSpecifications)
Parameters
Type Name Description
IEnumerable<FileTransferSpecification> fileTransferSpecifications

The file transfer specifications.

Returns
Type Description
Task<IEnumerable<FileTransferResult>>

Results from each download.

Remarks

If the Directory is null, the files will be downloaded to the current (working) directory. If the Directory is null, the files will be downloaded from the root of the blob container, otherwise they will be downloaded from the virtual directory specified by Directory.

View Source

UploadFilesAsync(IEnumerable<DataTransferSpecification>)

Uploads the files from the local file system to BLOB storage asynchronously. The Source must be of type SourceFileList, while Destination must be of type BlobContainerDestinationSpecification.

Declaration
public Task<IEnumerable<FileTransferResult>> UploadFilesAsync(IEnumerable<DataTransferSpecification> fileTransferSpecifications)
Parameters
Type Name Description
IEnumerable<DataTransferSpecification> fileTransferSpecifications

The file transfer specifications defining the files to be uploaded.

Returns
Type Description
Task<IEnumerable<FileTransferResult>>

A object that represents the file upload operation.

Remarks

If the Directory is null, the files will be uploaded to the root of the blob container, otherwise they will be uploaded to the virtual directory specified by Directory.

View Source

UploadFilesAsync(IEnumerable<FileTransferSpecification>)

Uploads the files from the local file system to BLOB storage asynchronously. The SourceSpecification must be of type FileSystemDirectorySpecification, while DestinationSpecification must be of type BlobDirectorySpecification.

Declaration
public Task<IEnumerable<FileTransferResult>> UploadFilesAsync(IEnumerable<FileTransferSpecification> fileTransferSpecifications)
Parameters
Type Name Description
IEnumerable<FileTransferSpecification> fileTransferSpecifications

The file transfer specifications defining the files to be uploaded.

Returns
Type Description
Task<IEnumerable<FileTransferResult>>

A object that represents the file upload operation.

Remarks

If the Directory is null, the files will be uploaded from the current (working) directory. If the Directory is null, the files will be uploaded to the root of the blob container, otherwise they will be uploaded to the virtual directory specified by Directory.

Events

View Source

FileFailed

Occurs when the transfer of a file fails.

Declaration
public event EventHandler<DataTransferEventArgs> FileFailed
Event Type
Type Description
EventHandler<DataTransferEventArgs>
View Source

FileSkipped

Occurs when the transfer of a file is skipped.

Declaration
public event EventHandler<DataTransferEventArgs> FileSkipped
Event Type
Type Description
EventHandler<DataTransferEventArgs>
View Source

FileTransferred

Occurs when a file has been successfully transferred.

Declaration
public event EventHandler<DataTransferEventArgs> FileTransferred
Event Type
Type Description
EventHandler<DataTransferEventArgs>

Implements

IFileTransferService

See Also

IFileTransferService
IFileTransferService
  • View Source
Back to top Copyright © DNV GL AS. All rights reserved.