diff --git a/src/main/java/de/seelab/codegenerator/ProjectContext.java b/src/main/java/de/seelab/codegenerator/ProjectContext.java index 2911007..8ef5de5 100644 --- a/src/main/java/de/seelab/codegenerator/ProjectContext.java +++ b/src/main/java/de/seelab/codegenerator/ProjectContext.java @@ -32,7 +32,7 @@ public void writeOutputFile(String namespace, String filename, String content) t public void writeOutputFile(String namespace, String filename, byte[] content) throws Exception { File file = new File(new File(outputDir.getAbsolutePath(), namespace.replace(".", "/")).getAbsoluteFile(), filename); - boolean mkdirs = file.getParentFile().mkdirs(); + boolean mkdirs = file.getParentFile().exists() || file.getParentFile().mkdirs(); if(!mkdirs) throw new IOException("Cannot create directory " + file.getParent()); FileUtils.writeByteArrayToFile(file, content); }