Interface IFileTransferService
Represents a service for transferring files from/to local disk from/to remote (cloud) storage.
Namespace: DNVGL.One.Compute.Core.DataTransfer
Assembly: DNVGL.One.Compute.Core.dll
Syntax
public interface IFileTransferService
Properties
View SourceShouldOverwrite
Gets or sets a callback to control when a destination file should be overwritten. Default is to always overwrite.
Declaration
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. |
ShouldTransfer
Gets or sets a callback to control when a file should be transferred. The default is to always transfer.
Declaration
Func<object, object, bool> ShouldTransfer { get; set; }
Property Value
Type | Description |
---|---|
Func<System.Object, System.Object, System.Boolean> | The callback to determine whether a file should be transferred. |
Remarks
This method could be used if the file selection is more complex than could be done by setting the selection and inclusion filters. The transfer logic is the following: selected and !excluded and ShouldTransfer.
Methods
View SourceDownloadFilesAsync(IEnumerable<FileTransferSpecification>)
Downloads the specified files asynchronously.
Declaration
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. |
UploadFilesAsync(IEnumerable<FileTransferSpecification>)
Uploads the specified files asynchronously.
Declaration
Task<IEnumerable<FileTransferResult>> UploadFilesAsync(IEnumerable<FileTransferSpecification> fileTransferSpecifications)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<FileTransferSpecification> | fileTransferSpecifications | The file transfer specifications. |
Returns
Type | Description |
---|---|
Task<IEnumerable<FileTransferResult>> | Results from each upload. |
Events
View SourceFileFailed
Occurs when the transfer of a file fails.
Declaration
event EventHandler<DataTransferEventArgs> FileFailed
Event Type
Type | Description |
---|---|
EventHandler<DataTransferEventArgs> |
FileSkipped
Occurs when the transfer of a file is skipped.
Declaration
event EventHandler<DataTransferEventArgs> FileSkipped
Event Type
Type | Description |
---|---|
EventHandler<DataTransferEventArgs> |
FileTransferred
Occurs when a file has been successfully transferred.
Declaration
event EventHandler<DataTransferEventArgs> FileTransferred
Event Type
Type | Description |
---|---|
EventHandler<DataTransferEventArgs> |