From 03db21ff2033022250d026c0d44950227ea40a8c Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Fri, 10 Jan 2014 16:03:13 +0000 Subject: [PATCH] * File.relativize --- source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy | 1 + 1 file changed, 1 insertion(+) diff --git a/source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy b/source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy index cfa8159d..cab680ba 100644 --- a/source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy +++ b/source/net/sourceforge/filebot/cli/ScriptShell.lib.groovy @@ -47,6 +47,7 @@ File.metaClass.validateFilePath = { validateFilePath(delegate) } File.metaClass.moveTo = { f -> moveRename(delegate, f as File) } File.metaClass.copyTo = { dir -> copyAs(delegate, new File(dir, delegate.getName())) } File.metaClass.getXattr = { new net.sourceforge.filebot.MetaAttributeView(delegate) } +File.metaClass.relativize = { f -> delegate.canonicalFile.toPath().relativize(f.canonicalFile.toPath()).toFile() } List.metaClass.mapByFolder = { mapByFolder(delegate) } List.metaClass.mapByExtension = { mapByExtension(delegate) } String.metaClass.getNameWithoutExtension = { getNameWithoutExtension(delegate) }