From 3ca390678d96a2b21b57b414db72820095ecbe07 Mon Sep 17 00:00:00 2001 From: Reinhard Pointner Date: Wed, 10 Aug 2016 17:53:52 +0800 Subject: [PATCH] readXml helper function --- source/net/filebot/format/ExpressionFormatFunctions.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/net/filebot/format/ExpressionFormatFunctions.java b/source/net/filebot/format/ExpressionFormatFunctions.java index 2745166f..df53f308 100644 --- a/source/net/filebot/format/ExpressionFormatFunctions.java +++ b/source/net/filebot/format/ExpressionFormatFunctions.java @@ -14,6 +14,7 @@ import java.util.regex.Pattern; import java.util.stream.Stream; import groovy.lang.Closure; +import groovy.util.XmlSlurper; /** * Global functions available in the {@link ExpressionFormat} @@ -72,4 +73,8 @@ public class ExpressionFormatFunctions { return streamLines(new File(path)).collect(toList()); } + public static Object readXml(String path) throws Exception { + return new XmlSlurper().parse(new File(path)); + } + }