From f81e2fa9ea30beec806446b94f657ab4c69ca795 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 18 Dec 2013 04:17:16 +0000 Subject: [PATCH] * add getRelativePathTail function --- .../net/sourceforge/filebot/format/ExpressionFormat.lib.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy b/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy index a6013729..77ad0500 100644 --- a/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy +++ b/source/net/sourceforge/filebot/format/ExpressionFormat.lib.groovy @@ -11,7 +11,8 @@ import java.util.regex.Pattern File.metaClass.getAt = { Range range -> listPath(delegate).collect{ replacePathSeparators(getName(it)).trim() }.getAt(range).join(File.separator) } File.metaClass.getAt = { int index -> listPath(delegate).collect{ replacePathSeparators(getName(it)).trim() }.getAt(index) } File.metaClass.getRoot = { listPath(delegate)[0] } -File.metaClass.listPath = { int tailSize = 100, boolean reversePath = false -> listPathTail(delegate, tailSize, reversePath) } +File.metaClass.listPath = { int tailSize = 255, boolean reversePath = false -> listPathTail(delegate, tailSize, reversePath) } +File.metaClass.getRelativePathTail = { int tailSize -> getRelativePathTail(delegate, tailSize) } File.metaClass.getDiskSpace = { listPath(delegate).reverse().find{ it.exists() }?.usableSpace ?: 0 }