1
0
mirror of https://github.com/mitb-archive/filebot synced 2024-08-13 17:03:45 -04:00

Move DSL utilities

This commit is contained in:
Reinhard Pointner 2019-04-24 13:58:41 +07:00
parent 13cfca422c
commit 2911ea488a
2 changed files with 27 additions and 24 deletions

View File

@ -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();
}

View File

@ -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();
}