fixed directory creation not checking capacity limit

This commit is contained in:
Florian Nücke 2013-11-25 14:36:12 +01:00
parent 5f0f5d79ff
commit 69048a92c4

View File

@ -27,12 +27,16 @@ trait Capacity extends OutputStreamFileSystem {
else false
}
override def makeDirectory(path: String) =
override def makeDirectory(path: String) = {
if (capacity - used < Config.fileCost) {
throw new io.IOException("not enough space")
}
if (super.makeDirectory(path)) {
used += Config.fileCost
true
}
else false
}
// ----------------------------------------------------------------------- //