From 2911ea488ac1c91bb288db1a591a04e25f841423 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 24 Apr 2019 13:58:41 +0700 Subject: [PATCH] Move DSL utilities --- .../net/filebot/cli/ScriptShellMethods.java | 24 ----------------- .../format/ExpressionFormatMethods.java | 27 +++++++++++++++++++ 2 files changed, 27 insertions(+), 24 deletions(-) diff --git a/source/net/filebot/cli/ScriptShellMethods.java b/source/net/filebot/cli/ScriptShellMethods.java index 78317b38..484a9e17 100644 --- a/source/net/filebot/cli/ScriptShellMethods.java +++ b/source/net/filebot/cli/ScriptShellMethods.java @@ -47,30 +47,6 @@ import net.filebot.web.WebRequest; public class ScriptShellMethods { - public static File plus(File self, String path) { - return new File(self.getPath().concat(path)); - } - - public static File div(File self, String path) { - return new File(self, path); - } - - public static File div(String self, String path) { - return new File(self, path); - } - - public static File div(File self, File path) { - return new File(self, path.getPath()); - } - - public static File div(String self, File path) { - return new File(self, path.getPath()); - } - - public static String negative(String self) { - return '-' + self; - } - public static String getAt(File self, int index) { return FileUtilities.listPath(self).get(index).getName(); } diff --git a/source/net/filebot/format/ExpressionFormatMethods.java b/source/net/filebot/format/ExpressionFormatMethods.java index 2c77bab9..03d0f961 100644 --- a/source/net/filebot/format/ExpressionFormatMethods.java +++ b/source/net/filebot/format/ExpressionFormatMethods.java @@ -649,6 +649,33 @@ public class ExpressionFormatMethods { return null; } + /** + * DSL utilities + */ + public static File plus(File self, String path) { + return new File(self.getPath().concat(path)); + } + + public static File div(File self, String path) { + return new File(self, path); + } + + public static File div(String self, String path) { + return new File(self, path); + } + + public static File div(File self, File path) { + return new File(self, path.getPath()); + } + + public static File div(String self, File path) { + return new File(self, path.getPath()); + } + + public static String negative(String self) { + return '-' + self; + } + private ExpressionFormatMethods() { throw new UnsupportedOperationException(); }