A basic implementation of the FlowrFileProvider interface for text files that caches the content after the first load (i.e., updates on disk are ignored).

Hierarchy (View Summary)

Hierarchy-Diagram

UML class diagram of FlowrTextFile

Constructors

Properties

filePath: PathLike

The role of this file, if any, in general your file should not decide for itself what role it has in the project context, this is for the loaders plugins to decide (cf. PluginType) as they can, e.g., respect ignore files, updated mappings, etc. However, they will 1) set this role as soon as they decide on it (using assignRole) and 2) try to respect an already assigned role (however, user configurations may override this).

Methods

  • The content of the file, this may be cached by the implementation and does not have to be expensive. You can used stream based implementations but right now there is no external, project-wide expressions of life cycles for files. So make sure your implementation closes the resource as soon as possible.

    Returns string

  • The path to the file, this is used for identification and logging purposes. If the file does not exist on disk, this can be a virtual path (e.g. for inline files). Even though this is a getter, please make sure that the operation is cheap and deterministic (some decorators may overwrite the path, e.g., because they support other protocols).

    Returns PathLike