In Java I can use the following code:
public class Ex {
public static void main(String [ ] args) {
String path = Ex.class.getProtectionDomain().getCodeSource().getLocation().getPath();
String decodedPath = URLDecoder.decode(path, "UTF-8");
}
}
but in Kotlin, the main function is defined outside out of a class. How can I get it's current file name?