Class BlobStorageFileTransferService
Implements the IFileTransferService contract, supporting transfer of files to/from Azure BLOB storage
Inheritance
Implements
Namespace: DNVGL.One.Compute.StorageLibrary.Azure.FileTransfer
Assembly: DNVGL.One.Compute.StorageLibrary.Azure.dll
Syntax
public class BlobStorageFileTransferService : object, IFileTransferService
Constructors
View SourceBlobStorageFileTransferService()
Initializes a new instance of the BlobStorageFileTransferService class.
Declaration
public BlobStorageFileTransferService()
Properties
View SourceInitialRequestRetryIntervalSeconds
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. |
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. |
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. |
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. |
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 SourceDownloadFilesAsync(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.
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 |
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.
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 |
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 SourceFileFailed
Occurs when the transfer of a file fails.
Declaration
public event EventHandler<DataTransferEventArgs> FileFailed
Event Type
Type | Description |
---|---|
EventHandler<DataTransferEventArgs> |
FileSkipped
Occurs when the transfer of a file is skipped.
Declaration
public event EventHandler<DataTransferEventArgs> FileSkipped
Event Type
Type | Description |
---|---|
EventHandler<DataTransferEventArgs> |
FileTransferred
Occurs when a file has been successfully transferred.
Declaration
public event EventHandler<DataTransferEventArgs> FileTransferred
Event Type
Type | Description |
---|---|
EventHandler<DataTransferEventArgs> |