diff --git a/source/net/filebot/format/ExpressionFormatFunctions.java b/source/net/filebot/format/ExpressionFormatFunctions.java index 2b3c80cf..1595e1a6 100644 --- a/source/net/filebot/format/ExpressionFormatFunctions.java +++ b/source/net/filebot/format/ExpressionFormatFunctions.java @@ -64,7 +64,7 @@ public class ExpressionFormatFunctions { return stream(c1, null, cN).map(Objects::toString).map(s -> q + s.replace(q, r) + q).collect(joining(" ")); } - public static Map csv(String path) throws IOException { + public static Map csv(Object path) throws IOException { Pattern[] delimiter = { TAB, SEMICOLON }; Map map = new LinkedHashMap(); for (String line : readLines(path)) { @@ -79,19 +79,19 @@ public class ExpressionFormatFunctions { return map; } - public static List readLines(String path) throws IOException { + public static List readLines(Object path) throws IOException { return FileUtilities.readLines(getUserFile(path)); } - public static Object readXml(String path) throws Exception { + public static Object readXml(Object path) throws Exception { return new XmlSlurper().parse(getUserFile(path)); } - public static File getUserFile(String path) { - File f = new File(path); + public static File getUserFile(Object path) { + File f = new File(path.toString()); if (!f.isAbsolute()) { - f = ApplicationFolder.UserHome.resolve(path); + f = ApplicationFolder.UserHome.resolve(f.getPath()); } if (isMacSandbox()) {