summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@yahooinc.com>2022-01-14 00:37:46 +0100
committerHåkon Hallingstad <hakon@yahooinc.com>2022-01-14 00:37:46 +0100
commit828ed146cb0186414638803b4c7cc024e12181d7 (patch)
treee94e2b5d6e34a2c629cb6602c24969c07fbf805a
parentbec5e614333dd19e3001df8bfb38beb0fae7d634 (diff)
Add getFileWriter to Template
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/task/util/template/Template.java6
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; }