/** * Find event name based on the launching url. By default, event name from the host object will be * used. But if we have some path entry in the host and it matches the one from the launch url - * his event name will be used. */ private String getEventName(ULHost host, Uri originalUri) { String event = host.getEvent(); final String originPath = originalUri.getPath().toLowerCase(); final List<ULPath> hostPathsList = host.getPaths(); for (ULPath hostPath : hostPathsList) { final String hostPathUrl = hostPath.getUrl(); if (hostPathUrl == null) { continue; } if (originPath.matches(hostPathUrl)) { event = hostPath.getEvent(); break; } } return event; }
/** Put host name and scheme into data block */ private void setHostData(JSONObject dataObject, ULHost host) throws JSONException { dataObject.put(JSDataKeys.HOST, host.getName()); dataObject.put(JSDataKeys.SCHEME, host.getScheme()); }