FileCopyActivity
Category: File Operations Namespace: CMS.Plugin.FlowManagement.Domain.FlowBusiness.Activitys Base Class: ActionActivity Module: FlowManagement.Domain
Overview
FileCopyActivity (Copy File) is a node used to copy files within a process. It inherits from ActionActivity and supports copying files from a specified path to a target path, with an option to overwrite existing files.
Business Scenarios
Applicable Scenarios
- File Backup: Copy files to a backup directory.
- File Distribution: Copy files to multiple locations.
- Data Archiving: Copy data files to an archive directory.
- Template Copying: Copy template files for generating new files.
Configuration Description
Basic Configuration
| Property Name | Type | Required | Default | Description |
|---|---|---|---|---|
| FilePath | string | Yes | - | Source file path |
| FilePathForCopy | string | Yes | - | Target path |
| OverWrite | bool | No | true | Whether to overwrite existing files |
Usage Examples
Basic Example
{
"Type": "FileCopyActivity",
"Name": "Backup Config File",
"Alias": "BackupConfig",
"FilePath": "C:\\Config\\settings.json",
"FilePathForCopy": "C:\\Backup\\settings.json",
"OverWrite": true
}
Notes
- ⚠️ Source file and target path cannot be the same.
- ⚠️ If the source file does not exist, a warning is recorded and the operation is skipped.
- ⚠️ If OverWrite is false and the target file exists, an exception will be thrown.
- 💡 Ensure the target directory exists, otherwise the copy will fail.
Related Nodes
- FileReadActivity: Read File Node
- FileWriteActivity: Write File Node
- FileMoveActivity: Move File Node
- FileDeleteActivity: Delete File Node
Update History
| Date | Version | Description |
|---|---|---|
| 2025-11-28 | 1.0 | Initial version |
Last updated: 2025-11-28