private Client newHttpClient() { final HttpAuthenticationFeature feature = HttpAuthenticationFeature.basicBuilder() .credentials(username, password).build(); final ClientConfig clientConfig = new ClientConfig(); clientConfig.register(feature); return ClientBuilder.newClient(clientConfig); }
private void setupClient() { HttpAuthenticationFeature feature = HttpAuthenticationFeature.basicBuilder() .credentials(username, password).build(); ClientConfig clientConfig = new ClientConfig(); clientConfig.register(feature); clientConfig.register(JsonToMapProvider.class); client = ClientBuilder.newClient(clientConfig); }
.basicBuilder() .credentials(defaultUser, defaultUserPassword) .build();
protected JsonClient(final RemoteService remote) { this.remote = Objects.requireNonNull(remote, "The remote parameter is null"); final ClientConfig clientConfig = new ClientConfig(); clientConfig.register(JacksonJsonProvider.class).register(JacksonSmileProvider.class); if (remote.isCredential()) { final HttpAuthenticationFeature feature = HttpAuthenticationFeature.basicBuilder() .nonPreemptive() .credentials(remote.username, remote.password) .build(); clientConfig.register(feature); } final int timeout = remote.timeout != null ? remote.timeout : DEFAULT_TIMEOUT; client = ClientBuilder.newClient(clientConfig); client.property(ClientProperties.CONNECT_TIMEOUT, timeout); client.property(ClientProperties.READ_TIMEOUT, timeout); }
private static HttpAuthenticationFeature build(Mode mode, String username, String password) { return new BuilderImpl(mode).credentials(username, password).build(); }
private static HttpAuthenticationFeature build(Mode mode, String username, byte[] password) { return new BuilderImpl(mode).credentials(username, password).build(); }
private static HttpAuthenticationFeature build(Mode mode, String username, String password) { return new BuilderImpl(mode).credentials(username, password).build(); }
private static HttpAuthenticationFeature build(Mode mode, String username, byte[] password) { return new BuilderImpl(mode).credentials(username, password).build(); }
private static HttpAuthenticationFeature build(Mode mode, String username, byte[] password) { return new BuilderImpl(mode).credentials(username, password).build(); }
private static HttpAuthenticationFeature build(Mode mode, String username, byte[] password) { return new BuilderImpl(mode).credentials(username, password).build(); }
private static HttpAuthenticationFeature build(Mode mode, String username, String password) { return new BuilderImpl(mode).credentials(username, password).build(); }
private static HttpAuthenticationFeature build(Mode mode, String username, String password) { return new BuilderImpl(mode).credentials(username, password).build(); }
HttpAuthenticationFeature httpAuthenticationFeature() { return HttpAuthenticationFeature .basicBuilder() .credentials("api", apiKey()) .build(); } }
private static HttpAuthenticationFeature build(Mode mode, String username, String password) { return new BuilderImpl(mode).credentials(username, password).build(); }
private static HttpAuthenticationFeature build(Mode mode, String username, byte[] password) { return new BuilderImpl(mode).credentials(username, password).build(); }
private static HttpAuthenticationFeature build(Mode mode, String username, String password) { return new BuilderImpl(mode).credentials(username, password).build(); }
private static HttpAuthenticationFeature build(Mode mode, String username, byte[] password) { return new BuilderImpl(mode).credentials(username, password).build(); }
private static HttpAuthenticationFeature build(Mode mode, String username, String password) { return new BuilderImpl(mode).credentials(username, password).build(); }
private static HttpAuthenticationFeature build(Mode mode, String username, byte[] password) { return new BuilderImpl(mode).credentials(username, password).build(); }