diff options
author | Valerij Fredriksen <freva@users.noreply.github.com> | 2022-01-14 08:42:40 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-14 08:42:40 +0100 |
commit | dc147802a302a4096043fb37552cf42292565d88 (patch) | |
tree | 1763c8a377ee0e32d90fa721f4029e844ce5e804 /node-admin | |
parent | c2d3f7d176f31425f30b74fa4bf6515d034aff96 (diff) | |
parent | 828ed146cb0186414638803b4c7cc024e12181d7 (diff) |
Merge pull request #20807 from vespa-engine/hakonhall/template-filewriter
Add getFileWriter to Template
Diffstat (limited to 'node-admin')
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Template.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Template.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Template.java index 41e8c3e65ce..ea55af17a0e 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Template.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Template.java @@ -1,6 +1,7 @@ // Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.hosted.node.admin.task.util.template; +import com.yahoo.vespa.hosted.node.admin.task.util.file.FileWriter; import com.yahoo.vespa.hosted.node.admin.task.util.file.UnixPath; import com.yahoo.vespa.hosted.node.admin.task.util.text.CursorRange; @@ -85,6 +86,11 @@ public class Template implements Form { return template; } + public FileWriter getFileWriterTo(Path path) { + String content = render(); + return new FileWriter(path, () -> content); + } + /** Must be called (if there is a parent) before any other method. */ void setParent(Template parent) { this.parent = parent; } |