if (this.outputDirectory != null) {
data = tryXmlFormatting(data);
File f = new File(this.outputDirectory, fileName);
if (!f.getParentFile().exists() && !f.getParentFile().mkdirs()) {
throw new LumifyException("Could not create directory: " + f.getParentFile().getAbsolutePath());
}
FileUtils.write(f, data);
}
} catch (IOException ex) {
throw new LumifyException("Could not write file: " + fileName + " with contents: " + data, ex);
}
}