Class CopyFileWorker
A worker that copies a file, including between different file system volumes.
Implements
Inherited Members
Namespace: actionETL
Assembly: actionETL.dll
Syntax
public class CopyFileWorker : WorkerBase<CopyFileWorker>, IDisposeOnFinished
Constructors
CopyFileWorker(WorkerParent, String, Func<Boolean>, String, String)
Initializes a new instance of the CopyFileWorker worker. It copies a file, including between different file system volumes.
Overwrite defaults to false.
Declaration
public CopyFileWorker(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, string sourceFileName, string targetFileName)
Parameters
Type | Name | Description |
---|---|---|
WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
Func<Boolean> | isStartableFunc | Function to calculate the worker start constraint; it should return |
String | sourceFileName | Name of the source file. |
String | targetFileName | Name of the target file. |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|
CopyFileWorker(WorkerParent, String, Func<Boolean>, String, String, Boolean)
Initializes a new instance of the CopyFileWorker worker. It copies a file, including between different file system volumes.
Declaration
public CopyFileWorker(WorkerParent workerParent, string workerName, Func<bool> isStartableFunc, string sourceFileName, string targetFileName, bool overwrite)
Parameters
Type | Name | Description |
---|---|---|
WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
Func<Boolean> | isStartableFunc | Function to calculate the worker start constraint; it should return |
String | sourceFileName | Name of the source file. |
String | targetFileName | Name of the target file. |
Boolean | overwrite | If set to |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|
CopyFileWorker(WorkerParent, String, String, String)
Initializes a new instance of the CopyFileWorker worker. It copies a file, including between different file system volumes.
Overwrite defaults to false.
Declaration
public CopyFileWorker(WorkerParent workerParent, string workerName, string sourceFileName, string targetFileName)
Parameters
Type | Name | Description |
---|---|---|
WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
String | sourceFileName | Name of the source file. |
String | targetFileName | Name of the target file. |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|
CopyFileWorker(WorkerParent, String, String, String, Boolean)
Initializes a new instance of the CopyFileWorker worker. It copies a file, including between different file system volumes.
Declaration
public CopyFileWorker(WorkerParent workerParent, string workerName, string sourceFileName, string targetFileName, bool overwrite)
Parameters
Type | Name | Description |
---|---|---|
WorkerParent | workerParent | The parent worker or worker system that the new child worker will be added to. Cannot be |
String | workerName | Name of the worker.
Set to a prefix plus a trailing
While less useful, set to
The name cannot otherwise contain |
String | sourceFileName | Name of the source file. |
String | targetFileName | Name of the target file. |
Boolean | overwrite | If set to |
Exceptions
Type | Condition |
---|---|
ArgumentException |
|
ArgumentNullException |
|
InvalidOperationException |
|
Properties
SourceFileName
Gets or sets the name of the source file. Cannot be set after the worker has started running.
Note: This property is thread-safe.
Declaration
public string SourceFileName { get; set; }
Property Value
Type | Description |
---|---|
String |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Cannot set the value after the worker has started running. |
TargetFileName
Gets or sets the name of the target file. Cannot be set after the worker has started running.
Note: This property is thread-safe.
Declaration
public string TargetFileName { get; set; }
Property Value
Type | Description |
---|---|
String |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Cannot set the value after the worker has started running. |
Methods
RunAsync()
This method can be overridden to add custom functionality to the derived worker that runs before
and after the file processing. In this case, the base class base.RunAsync()
must
be called for the worker to function correctly.
Typically, this worker is used without overriding this method.
Declaration
protected override async Task<OutcomeStatus> RunAsync()
Returns
Type | Description |
---|---|
Task<OutcomeStatus> | A |