org.sonatype.nexus.repository.rest.api.model.HttpClientConnectionAuthenticationAttributes Java Examples

The following examples show how to use org.sonatype.nexus.repository.rest.api.model.HttpClientConnectionAuthenticationAttributes. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ProxyRepositoryApiRequestToConfigurationConverter.java    From nexus-public with Eclipse Public License 1.0 5 votes vote down vote up
private void convertAuthentication(
    final HttpClientAttributes httpClient,
    final NestedAttributesMap httpClientConfiguration)
{
  HttpClientConnectionAuthenticationAttributes authentication = httpClient.getAuthentication();
  if (nonNull(authentication)) {
    NestedAttributesMap authenticationConfiguration = httpClientConfiguration.child("authentication");
    authenticationConfiguration.set("type", authentication.getType());
    authenticationConfiguration.set("username", authentication.getUsername());
    authenticationConfiguration.set("password", authentication.getPassword());
    authenticationConfiguration.set("ntlmHost", authentication.getNtlmHost());
    authenticationConfiguration.set("ntlmDomain", authentication.getNtlmDomain());
  }
}