CopyFiles Class
Copies the content of files from one path on to another path.
Namespace
Statiq.Core
Interfaces
Base Types
graph BT Type-->Base0["ParallelConfigModule<IEnumerable<string>>"] Base0-->Base1["Module"] click Base1 "/api/Statiq.Common/Module" Base1-->Base2["object"] Type-.->Interface0["IModule"] click Interface0 "/api/Statiq.Common/IModule" Type-.->Interface1["IParallelModule"] click Interface1 "/api/Statiq.Common/IParallelModule" Type["CopyFiles"] class Type type-node

Syntax

public class CopyFiles : ParallelConfigModule<IEnumerable<string>>, IModule, IParallelModule

Remarks

By default, files are copied from the input folder (or a subfolder) to the same relative location in the output folder, but this doesn't have to be the case. The output of this module are documents representing the files copied by the module. Note that the input documents are not output by this module.

Constructors

Name Summary
CopyFiles(Config<IEnumerable<string>>) Copies all files that match the specified globbing patterns and/or absolute paths. This allows you to specify different patterns and/or paths depending on the input document. When this constructor is used, the module is evaluated once for every input document, which may result in copying the same file more than once (and may also result in IO conflicts since copying is typically done in parallel). It is recommended you only specify a function-based source path if there will be no overlap between the path returned from each input document.
CopyFiles(string[]) Copies all files that match the specified globbing patterns and/or absolute paths. When this constructor is used, the module is evaluated only once against empty input document. This makes it possible to string multiple CopyFiles modules together in one pipeline. Keep in mind that the result of the whole pipeline in this case will be documents representing the files copied only by the last CopyFiles module in the pipeline (since the output documents of the previous CopyFiles modules will have been consumed by the last one).

Methods

Name Return Value Summary
AfterExecution(IExecutionContext, ExecutionOutputs) void
Called after each module execution.
Inherited from Module
AfterExecutionAsync(IExecutionContext, ExecutionOutputs) Task
Called after each module execution.
Inherited from Module
BeforeExecution(IExecutionContext) void
Called before each module execution.
Inherited from Module
BeforeExecutionAsync(IExecutionContext) Task
Called before each module execution.
Inherited from Module
ExecuteAsync(IExecutionContext) Task<IEnumerable<IDocument>>
This should not be called directly, instead call IExecutionContext.Execute() if you need to execute a module from within another module.
Inherited from Module
ExecuteConfigAsync(IDocument, IExecutionContext, IEnumerable<string>) Task<IEnumerable<IDocument>>
Finally(IExecutionContext) void
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
FinallyAsync(IExecutionContext) Task
Called after each module execution, even if an exception is thrown during execution.
Inherited from Module
To(Func<IFile, IFile, Task<NormalizedPath>>) CopyFiles
Specifies an alternate destination path for each file (by default files are copied to their same relative path in the output directory). The output of the function should be the full file path (including file name) of the destination file. If the delegate returns null for a particular file, that file will not be copied. This overload allows you to view the IFile where the module would normally have copied the file to and then manipulate it (or not) as appropriate.
To(Func<IFile, Task<NormalizedPath>>) CopyFiles
Specifies an alternate destination path for each file (by default files are copied to their same relative path in the output directory). The output of the function should be the full file path (including file name) of the destination file. If the delegate returns null for a particular file, that file will not be copied.
Where(Func<IFile, Task<bool>>) CopyFiles
Specifies a predicate that must be satisfied for the file to be copied.

Extension Methods