--- a/src/main/scala/Filesystem.scala Wed Apr 04 18:23:20 2012 +0200
+++ b/src/main/scala/Filesystem.scala Wed Apr 04 22:31:39 2012 +0200
@@ -25,6 +25,7 @@
def name() = url
val relativePath: String = url.getPath.replaceAll("^"+basePath.toString+"/?", "")
val fileOnDisk = new File(baseDirectory, relativePath)
+ lazy val parent = fileOnDisk.getParentFile
private def parentMustExist(): Unit = {
val parent = fileOnDisk.getParentFile
@@ -74,7 +75,7 @@
def save(model: Model): Validation[Throwable, Unit] =
try {
- createFileOnDisk()
+ parent.mkdirs()
val fos = new FileOutputStream(fileOnDisk)
val writer = model.getWriter(lang.jenaLang)
writer.write(model, fos, url.toString)