ReadFiles Class
Reads the content of files from the file system into the content of new documents.
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["ReadFiles"] class Type type-node

Syntax

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

Remarks

This module will be executed once and input documents will be ignored if search patterns are specified. Otherwise, if a delegate is specified, the module will be executed once per input document and the resulting output documents will be aggregated. In either case, the input documents will not be returned as output of this module. Source will be set to the absolute path of the file (use GetRelativeInputPath() to get a source path relative to the input folders). Destination will be set to the relative path of the file (so that WriteFiles will write it to the same relative path in the output folder).

Constructors

Name Summary
ReadFiles(Config<IEnumerable<string>>) Reads 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.
ReadFiles(Config<string>) Reads all files that match the specified globbing pattern and/or absolute path. This allows you to specify different patterns and/or paths depending on the input.
ReadFiles(IEnumerable<string>) Reads all files that match the specified globbing patterns and/or absolute paths.
ReadFiles(string[]) Reads all files that match the specified globbing patterns and/or absolute paths.

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
Where(Func<IFile, Task<bool>>) ReadFiles
Specifies a predicate that must be satisfied for the file to be read.
WithMediaType(Func<IFile, string>) ReadFiles
Specifies a function to set the media type for each file.

Extension Methods