Source:
private void mpathwaysCall(HttpServletRequest request, HttpServletResponse response, PrintWriter out){ WAPIResultWrapper wrappedResult = null; String uniqname = null; TcSessionData tc = (TcSessionData) request.getSession().getAttribute(TC_SESSION_DATA); if( tc != null){ uniqname = (String) tc.getCustomValuesMap().get("custom_canvas_user_login_id"); } M_log.debug("WAPI uniqname: " + uniqname); String mpathwaysTermId = request.getParameter(PARAMETER_TERMID); if(uniqname == null || mpathwaysTermId == null){ response.setStatus(400); wrappedResult = new WAPIResultWrapper(400, "Parameter missing in Instructors request", new JSONObject()); M_log.error("Error in mpathwaysCall(), missing parameter in Instuctors request"); } else{ if(appExtSecurePropertiesFile!=null) { HashMap<String, String> wapiValuesMap = new HashMap<String, String>(); wapiValuesMap.put("tokenServer", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_TOKEN_SERVER)); wapiValuesMap.put("apiPrefix", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_PREFIX)); wapiValuesMap.put("key", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_KEY)); wapiValuesMap.put("secret", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_SECRET)); WAPI wapi = new WAPI(wapiValuesMap); try { M_log.info("WAPI URL: " + wapi.getApiPrefix() + uniqname + "/Terms/" + mpathwaysTermId + "/Classes"); wrappedResult = wapi.getRequest(wapi.getApiPrefix() + uniqname + "/Terms/" + mpathwaysTermId + "/Classes"); } catch (UnirestException e) { M_log.error("MPathways API call did not complete successfully", e); } } } out.print(wrappedResult.toJson()); out.flush(); }

Target:
private void mpathwaysCall(HttpServletRequest request, HttpServletResponse response, PrintWriter out){ WAPIResultWrapper wrappedResult = null; String uniqname = null; TcSessionData tc = (TcSessionData) request.getSession().getAttribute(TC_SESSION_DATA); if( tc != null){ uniqname = (String) tc.getCustomValuesMap().get("custom_canvas_user_login_id"); } M_log.debug("WAPI uniqname: " + uniqname); String mpathwaysTermId = request.getParameter(PARAMETER_TERMID); if(uniqname == null || mpathwaysTermId == null){ response.setStatus(400); wrappedResult = new WAPIResultWrapper(400, "Parameter missing in Instructors request", new JSONObject()); M_log.error("Error in mpathwaysCall(), missing parameter in Instuctors request"); } else{ if(appExtSecurePropertiesFile!=null) { HashMap<String, String> wapiValuesMap = new HashMap<String, String>(); wapiValuesMap.put("tokenServer", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_TOKEN_SERVER)); wapiValuesMap.put("apiPrefix", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_PREFIX)); wapiValuesMap.put("key", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_KEY)); wapiValuesMap.put("secret", appExtSecurePropertiesFile.getProperty(SectionUtilityToolFilter.ESB_SECRET)); WAPI wapi = new WAPI(wapiValuesMap); try { String url = wapi.getApiPrefix() + uniqname + "/Terms/" + mpathwaysTermId + "/Classes"; M_log.info("WAPI URL: " + url); wrappedResult = wapi.getRequest(url); } catch (UnirestException e) { M_log.error("MPathways API call did not complete successfully", e); } } } out.print(wrappedResult.toJson()); out.flush(); }