Copies a group of source files to a group of targets. At workflow execution time, if at least one error occurs, a FileActionException is thrown.
The File Copy Action returns its results in the flow context variable “result”. These results include listings of all files that were successfully copied, including source locations and target destinations, in various formats. You can access the file copy results from the following fields:
|Flow Context Variable||Field||Java Type||Description||Prescript / Postscript Example|
|RESULT||filenames||Map<String, String>||A map of file sources to destinations for files that were successfully copied. |
The keys of the map are the original filenames for the source file that was copied. The values of the map are the filenames of the files as stored at the destination location.
This result contains file names only and does not include file path/directory information.
For example, if the action copies a file from /outputs/atlanta/settlements.zip to an FTP location /inputs/atlanta/settlements_final.zip, this result will contain an entry for that copy with the key settlements.zip and the value settlements_final.zip.
|RESULT||url_objects||Map<URL, URL>||A map of file sources to destinations for files that were successfully copied. |
The keys of the map are URL objects containing the location of the source file that was copied. The values of the map are URL objects with the location of the files at the destination location.
This field contains the same information as the “url_strings” field, except file names, are stored as URL objects, not strings.
For all non-file protocols, this map contains the same information as the “url_strings” field.
|RESULT||url_strings||Map<String, String>||URLs of files for which the file action was carried out successfully. |
This field contains the same information as the “url_objects” field, except file names, are stored as strings, not URL objects.
To set the collection for a For Each Collection Element Action, add the following data map on the flow going into the For Each action:
To copy the collection into a new variable (for future reference or to reuse the data later in the workflow), you could use a data map like: