Source:
protected HttpConfiguration getOAuthHttpConfiguration() throws MalformedURLException { HttpConfiguration httpConfiguration = new HttpConfiguration(); httpConfiguration .setHttpMethod(Constants.HTTP_CONFIG_DEFAULT_HTTP_METHOD); String mode = this.configurationMap.get(Constants.MODE); String endPointUrl = this.configurationMap.get(Constants.OAUTH_ENDPOINT); if (endPointUrl == null || endPointUrl.trim().isEmpty()) { if (Constants.SANDBOX.equalsIgnoreCase(mode)) { endPointUrl = Constants.REST_SANDBOX_ENDPOINT; } else if (Constants.LIVE.equalsIgnoreCase(mode)) { endPointUrl = Constants.REST_LIVE_ENDPOINT; } else if (endPointUrl == null || endPointUrl.length() <= 0) { endPointUrl = this.configurationMap.get(Constants.ENDPOINT); } } if (endPointUrl == null || endPointUrl.trim().length() <= 0) { throw new MalformedURLException( "oauth.Endpoint, mode or service.EndPoint not set not configured to sandbox/live "); } if (Boolean .parseBoolean(configurationMap.get(Constants.USE_HTTP_PROXY))) { httpConfiguration.setProxySet(true); httpConfiguration.setProxyHost(configurationMap .get(Constants.HTTP_PROXY_HOST)); httpConfiguration.setProxyPort(Integer.parseInt(configurationMap .get(Constants.HTTP_PROXY_PORT))); String proxyUserName = configurationMap .get(Constants.HTTP_PROXY_USERNAME); String proxyPassword = configurationMap .get(Constants.HTTP_PROXY_PASSWORD); if (proxyUserName != null && proxyPassword != null) { httpConfiguration.setProxyUserName(proxyUserName); httpConfiguration.setProxyPassword(proxyPassword); } } endPointUrl = (endPointUrl.endsWith("/")) ? endPointUrl.substring(0, endPointUrl.length() - 1) : endPointUrl; endPointUrl += OAUTH_TOKEN_PATH; httpConfiguration.setEndPointUrl(endPointUrl); httpConfiguration .setGoogleAppEngine(Boolean.parseBoolean(configurationMap .get(Constants.GOOGLE_APP_ENGINE))); return httpConfiguration; }

Target:
protected HttpConfiguration getOAuthHttpConfiguration() throws MalformedURLException { HttpConfiguration httpConfiguration = new HttpConfiguration(); httpConfiguration .setHttpMethod(Constants.HTTP_CONFIG_DEFAULT_HTTP_METHOD); final String mode = this.configurationMap.get(Constants.MODE); String endPointUrl = this.configurationMap.get(Constants.OAUTH_ENDPOINT); if (endPointUrl == null || endPointUrl.trim().isEmpty()) { if (Constants.SANDBOX.equalsIgnoreCase(mode)) { endPointUrl = Constants.REST_SANDBOX_ENDPOINT; } else if (Constants.LIVE.equalsIgnoreCase(mode)) { endPointUrl = Constants.REST_LIVE_ENDPOINT; } else if (endPointUrl == null || endPointUrl.length() <= 0) { endPointUrl = this.configurationMap.get(Constants.ENDPOINT); } } if (endPointUrl == null || endPointUrl.trim().length() <= 0) { throw new MalformedURLException( "oauth.Endpoint, mode or service.EndPoint not set not configured to sandbox/live "); } if (Boolean .parseBoolean(configurationMap.get(Constants.USE_HTTP_PROXY))) { httpConfiguration.setProxySet(true); httpConfiguration.setProxyHost(configurationMap .get(Constants.HTTP_PROXY_HOST)); httpConfiguration.setProxyPort(Integer.parseInt(configurationMap .get(Constants.HTTP_PROXY_PORT))); String proxyUserName = configurationMap .get(Constants.HTTP_PROXY_USERNAME); String proxyPassword = configurationMap .get(Constants.HTTP_PROXY_PASSWORD); if (proxyUserName != null && proxyPassword != null) { httpConfiguration.setProxyUserName(proxyUserName); httpConfiguration.setProxyPassword(proxyPassword); } } endPointUrl = (endPointUrl.endsWith("/")) ? endPointUrl.substring(0, endPointUrl.length() - 1) : endPointUrl; endPointUrl += OAUTH_TOKEN_PATH; httpConfiguration.setEndPointUrl(endPointUrl); httpConfiguration .setGoogleAppEngine(Boolean.parseBoolean(configurationMap .get(Constants.GOOGLE_APP_ENGINE))); return httpConfiguration; }