This commit provides an advanced handling of generated files that provides more control over files registration. The callback provides a FileHandler that can determine if the file already exists and its content. The caller can then chose to override the content or leave it as it is. Closes gh-31331