summaryrefslogtreecommitdiffstats
path: root/utils/src/main/java
diff options
context:
space:
mode:
authorLiam Fallon <liam.fallon@est.tech>2020-01-23 13:35:07 +0000
committerGerrit Code Review <gerrit@onap.org>2020-01-23 13:35:07 +0000
commitddf0410c7ad3721c2169dfb6c06234b680766c8a (patch)
tree750ca6645e7e7b57b052ef340be01a96ce3d9d31 /utils/src/main/java
parentb46e315c8f803e4fb54fc7ba49b94b8052f1c037 (diff)
parentb4f69e428f1677339ff432c27e2cb8bfa756114e (diff)
Merge "Create path to text file being created"
Diffstat (limited to 'utils/src/main/java')
-rw-r--r--utils/src/main/java/org/onap/policy/common/utils/resources/TextFileUtils.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/utils/src/main/java/org/onap/policy/common/utils/resources/TextFileUtils.java b/utils/src/main/java/org/onap/policy/common/utils/resources/TextFileUtils.java
index 5aeacf26..01af7fd8 100644
--- a/utils/src/main/java/org/onap/policy/common/utils/resources/TextFileUtils.java
+++ b/utils/src/main/java/org/onap/policy/common/utils/resources/TextFileUtils.java
@@ -62,6 +62,10 @@ public abstract class TextFileUtils {
*/
public static void putStringAsTextFile(final String outString, final String textFilePath) throws IOException {
final File textFile = new File(textFilePath);
+ if (!textFile.getParentFile().exists()) {
+ textFile.getParentFile().mkdirs();
+ }
+
putStringAsFile(outString, textFile);
}