public static URLBuilder urlBuilder(Context cx, Scriptable thisObj, java.lang.Object[] args, Function funObj) throws JavaScriptException, FormattingException, WGAPIException, MalformedURLException, UnsupportedEncodingException {
TMLContext tmlContext = fetchInitialContext(cx);
URL wgaUrl = new URL((String) tmlContext.meta("request", "absolutewgaurl"));
String baseURL;
if (args.length >= 1) {
baseURL = String.valueOf(args[0]);
}
else {