Package land.oras.auth
Class HttpClient.Builder
java.lang.Object
land.oras.auth.HttpClient.Builder
- Enclosing class:
- HttpClient
Builder for the HTTP client
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Build the clientstatic HttpClient.Builderbuilder()Build the clientwithCaContent(String caContent) Set the CA certificates from PEM-encoded contentwithCaFile(String caFilePath) Set the CA file for TLS verificationwithCaFile(Path caFilePath) Set the CA file for TLS verificationwithMeterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry) Set the meter registry for metrics.withSkipTlsVerify(boolean skipTlsVerify) Skip the TLS verificationwithTimeout(@Nullable Integer timeout) Set the timeout
-
Method Details
-
withTimeout
Set the timeout- Parameters:
timeout- The timeout in seconds- Returns:
- The builder
-
withSkipTlsVerify
Skip the TLS verification- Parameters:
skipTlsVerify- Skip TLS verification- Returns:
- The builder
-
withMeterRegistry
public HttpClient.Builder withMeterRegistry(io.micrometer.core.instrument.MeterRegistry meterRegistry) Set the meter registry for metrics. Following Micrometer best practices for libraries,- Parameters:
meterRegistry- The meter registry- Returns:
- The builder
-
withCaFile
Set the CA file for TLS verification- Parameters:
caFilePath- The path to a PEM-encoded CA certificate or bundle- Returns:
- The builder
-
withCaFile
Set the CA file for TLS verification- Parameters:
caFilePath- The path to a PEM-encoded CA certificate or bundle- Returns:
- The builder
-
withCaContent
Set the CA certificates from PEM-encoded content- Parameters:
caContent- The PEM-encoded CA certificate or bundle content- Returns:
- The builder
-
builder
Build the client- Returns:
- The client
-
build
Build the client- Returns:
- The client
-