summaryrefslogtreecommitdiffstats
path: root/utils/src/main/java
diff options
context:
space:
mode:
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);
}