Path#getParent can return null. Change-Id: I01f13ac426dda4c007cc5caab546a0c9be62ce76 Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>tags/v5.11.0.202102031030-m2
@@ -511,7 +511,10 @@ public abstract class FS { | |||
} | |||
private static void write(Path p, String body) throws IOException { | |||
FileUtils.mkdirs(p.getParent().toFile(), true); | |||
Path parent = p.getParent(); | |||
if (parent != null) { | |||
FileUtils.mkdirs(parent.toFile(), true); | |||
} | |||
try (Writer w = new OutputStreamWriter(Files.newOutputStream(p), | |||
UTF_8)) { | |||
w.write(body); |