* added File.diskSize that works even for paths that don't exist

This commit is contained in:
Reinhard Pointner 2013-01-29 08:54:50 +00:00
parent 5695b9b84f
commit 5683b85d4b
1 changed files with 1 additions and 0 deletions

View File

@ -16,6 +16,7 @@ File.metaClass.getAt = { Range range -> listPath(delegate).collect{ replacePathS
File.metaClass.getAt = { int index -> listPath(delegate).collect{ replacePathSeparators(getName(it)).trim() }.getAt(index) } File.metaClass.getAt = { int index -> listPath(delegate).collect{ replacePathSeparators(getName(it)).trim() }.getAt(index) }
File.metaClass.getRoot = { listPath(delegate)[0] } File.metaClass.getRoot = { listPath(delegate)[0] }
File.metaClass.listPath = { listPath(delegate) } File.metaClass.listPath = { listPath(delegate) }
File.metaClass.getDiskSpace = { listPath(delegate).reverse().find{ it.exists() }.usableSpace }
/** /**