Package org.sonatype.nexus.httpclient.HttpClientFactory

Examples of org.sonatype.nexus.httpclient.HttpClientFactory.Builder.build()


  public HttpClient create(final ProxyRepository proxyRepository, final RemoteStorageContext ctx) {
    checkNotNull(proxyRepository);
    checkNotNull(ctx);
    final Builder builder = httpClientFactory.prepare(new RemoteStorageContextCustomizer(ctx));
    configure(builder);
    return builder.build();
  }

  @Override
  public void release(final ProxyRepository proxyRepository, final RemoteStorageContext ctx) {
    // nop for now
View Full Code Here


                  chain.set(session.getPeerCertificates());
                }
              }
            }
          });
      httpClientBuilder.build().execute(new HttpGet("https://" + host + ":" + port));
      return chain.get();
    }
    finally {
      if (connectionManager != null) {
        connectionManager.shutdown();
View Full Code Here

          null);

      // just to grab UA
      final Builder builder = testSubject.prepare(new RemoteStorageContextCustomizer(globalRemoteStorageContext));
      final String userAgent = builder.getUserAgent();
      final HttpClient client = builder.build();

      activity.perform(client);

      assertThat(userAgentChecker.getUserAgents(), hasSize(1)); // same UA should be used even if multiple reqs
      assertThat(userAgentChecker.getUserAgents().iterator().next(), equalTo(userAgent)); // the one we set must be used
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.