public String toString() { XmlConfigContext env = XmlConfigContext.getCurrent(); if (env != null) { String file = env.getBaseUri(); if (file != null) { String dir = Vfs.lookup(file).getParent().getURL(); return Vfs.decode(dir); } else return null; } else throw new IllegalStateException(L.l("__DIR__ is only available during configuration")); }