Source:
private void execute(final MetadataNotifier notifier, List<? extends NameValuePair> data) throws MetadataNotifierClientException { try { HttpPost method = new HttpPost(notifier.getUrl()); final UrlEncodedFormEntity entity = new UrlEncodedFormEntity(data, Charset.forName("UTF-8")); final RequestConfig.Builder configBuilder = RequestConfig.custom(); configBuilder.setMaxRedirects(3); method.addHeader("accept-charset", "UTF-8"); method.setEntity(entity); final boolean authenticationEnabled = StringUtils.isNotBlank(notifier.getUsername()) && notifier.getPassword() != null && notifier.getPassword().length > 0; configBuilder.setAuthenticationEnabled(authenticationEnabled); method.setConfig(configBuilder.build()); final String requestHost = method.getURI().getHost(); ClientHttpResponse response = requestFactory.execute(method, new Function<HttpClientBuilder, Void>() { @Nullable @Override public Void apply(@Nullable HttpClientBuilder requestBuilder) { final CredentialsProvider provider = Lib.net.setupProxy(settingManager, requestBuilder, requestHost); if (authenticationEnabled) { Log.debug("MetadataNotifierClient", "webUpdate: SET USER -> " + notifier.getUsername()); provider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(notifier.getUsername(), String.copyValueOf(notifier.getPassword()))); configBuilder.setAuthenticationEnabled(true); } return null; } }); try { if (response.getStatusCode() != HttpStatus.OK) { throw new MetadataNotifierClientException("Method failed: " + response.getStatusText()); } try { final InputStream instream = response.getBody(); IOUtils.closeQuietly(instream); } catch (final IOException ignore) { } } finally { method.releaseConnection(); } } catch (IOException e) { throw new MetadataNotifierClientException(e); } }

Target:
private void execute(final MetadataNotifier notifier, List<? extends NameValuePair> data) throws MetadataNotifierClientException { try { HttpPost method = new HttpPost(notifier.getUrl()); final UrlEncodedFormEntity entity = new UrlEncodedFormEntity(data, StandardCharsets.UTF_8); final RequestConfig.Builder configBuilder = RequestConfig.custom(); configBuilder.setMaxRedirects(3); method.addHeader(org.apache.http.HttpHeaders.ACCEPT_CHARSET, StandardCharsets.UTF_8.name()); method.setEntity(entity); final boolean authenticationEnabled = StringUtils.isNotBlank(notifier.getUsername()) && notifier.getPassword() != null && notifier.getPassword().length > 0; configBuilder.setAuthenticationEnabled(authenticationEnabled); method.setConfig(configBuilder.build()); final String requestHost = method.getURI().getHost(); ClientHttpResponse response = requestFactory.execute(method, new Function<HttpClientBuilder, Void>() { @Nullable @Override public Void apply(@Nullable HttpClientBuilder requestBuilder) { final CredentialsProvider provider = Lib.net.setupProxy(settingManager, requestBuilder, requestHost); if (authenticationEnabled) { Log.debug("MetadataNotifierClient", "webUpdate: SET USER -> " + notifier.getUsername()); provider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(notifier.getUsername(), String.copyValueOf(notifier.getPassword()))); configBuilder.setAuthenticationEnabled(true); } return null; } }); try { if (response.getStatusCode() != HttpStatus.OK) { throw new MetadataNotifierClientException("Method failed: " + response.getStatusText()); } try { final InputStream instream = response.getBody(); IOUtils.closeQuietly(instream); } catch (final IOException ignore) { } } finally { method.releaseConnection(); } } catch (IOException e) { throw new MetadataNotifierClientException(e); } }