Package io.minio

Class Http

java.lang.Object
io.minio.Http

public class Http extends Object
HTTP utilities.
  • Field Details

    • DEFAULT_MEDIA_TYPE

      public static final okhttp3.MediaType DEFAULT_MEDIA_TYPE
    • XML_MEDIA_TYPE

      public static final okhttp3.MediaType XML_MEDIA_TYPE
    • JSON_MEDIA_TYPE

      public static final okhttp3.MediaType JSON_MEDIA_TYPE
    • US_EAST_1

      public static final String US_EAST_1
      See Also:
    • DEFAULT_TIMEOUT

      public static final long DEFAULT_TIMEOUT
    • EMPTY_BODY

      public static final Http.Body EMPTY_BODY
    • RETRIABLE_STATUS_CODES

      public static final Set<Integer> RETRIABLE_STATUS_CODES
    • END_HTTP

      public static final String END_HTTP
      See Also:
    • UPLOAD_ID

      public static final String UPLOAD_ID
      See Also:
    • TRACE_QUERY_PARAMS

      public static final Set<String> TRACE_QUERY_PARAMS
  • Constructor Details

    • Http

      public Http()
  • Method Details

    • mediaType

      public static okhttp3.MediaType mediaType(String value)
      Gets media type of the specified string value.
    • enableJKSCertificates

      public static okhttp3.OkHttpClient enableJKSCertificates(okhttp3.OkHttpClient httpClient, String trustStorePath, String trustStorePassword, String keyStorePath, String keyStorePassword) throws MinioException
      Enables JKS formatted TLS certificates to the specified HTTP client.
      Throws:
      MinioException
    • enablePKCS12Certificates

      public static okhttp3.OkHttpClient enablePKCS12Certificates(okhttp3.OkHttpClient httpClient, String trustStorePath, String trustStorePassword, String keyStorePath, String keyStorePassword) throws MinioException
      Enables PKCS12 formatted TLS certificates to the specified HTTP client.
      Throws:
      MinioException
    • enableExternalCertificates

      public static okhttp3.OkHttpClient enableExternalCertificates(okhttp3.OkHttpClient client, String filePath, String dirPath) throws MinioException
      Enable external TLS certificates from given file path and all valid files from dir path.
      Throws:
      MinioException
    • enableExternalCertificatesFromEnv

      public static okhttp3.OkHttpClient enableExternalCertificatesFromEnv(okhttp3.OkHttpClient client) throws MinioException
      Enables external TLS certificates from SSL_CERT_FILE and SSL_CERT_DIR environment variables if present.
      Throws:
      MinioException
    • getRequestTraces

      public static String getRequestTraces(okhttp3.Request request, String bodyString)
    • getResponseTraces

      public static String getResponseTraces(okhttp3.Response response, Http.Method method, Http.QueryParameters queryParams, boolean isBucketRequest) throws IOException
      Throws:
      IOException
    • newDefaultClient

      public static okhttp3.OkHttpClient newDefaultClient()
      Creates new HTTP client with default timeout with additional TLS certificates from SSL_CERT_FILE and SSL_CERT_DIR environment variables if present.
    • disableCertCheck

      public static okhttp3.OkHttpClient disableCertCheck(okhttp3.OkHttpClient client) throws MinioException
      Disables TLS certificate check as a special case for self-signed certificate and testing to the specified HTTP client.
      Throws:
      MinioException
    • setTimeout

      public static okhttp3.OkHttpClient setTimeout(okhttp3.OkHttpClient client, long connectTimeout, long writeTimeout, long readTimeout)
      Sets connect, write and read timeout in milliseconds to the specified HTTP client.