Class StandardHttpRequestor.Config.Builder

java.lang.Object
com.dropbox.core.http.StandardHttpRequestor.Config.Builder
Enclosing class:
StandardHttpRequestor.Config

public static final class StandardHttpRequestor.Config.Builder extends Object
  • Method Details

    • withProxy

      public StandardHttpRequestor.Config.Builder withProxy(Proxy proxy)
      Set proxy configuration for network connections.
      Parameters:
      proxy - Proxy configuration
      Returns:
      this builder
      Throws:
      NullPointerException - if proxy is null
    • withNoConnectTimeout

      public StandardHttpRequestor.Config.Builder withNoConnectTimeout()
      Disables timeouts for opening a connection to the servers.
      Returns:
      this builder
    • withConnectTimeout

      public StandardHttpRequestor.Config.Builder withConnectTimeout(long timeout, TimeUnit unit)
      Set timeout for opening a connection to the servers. A timeout of 0 will disable any connnect timeouts.
      Parameters:
      timeout - time to wait for a network connection to open
      unit - unit of time
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if timeout is negative
      NullPointerException - if unit is null
    • withNoReadTimeout

      public StandardHttpRequestor.Config.Builder withNoReadTimeout()
      Disables timeout for receiving a response from the servers.
      Returns:
      this builder
    • withReadTimeout

      public StandardHttpRequestor.Config.Builder withReadTimeout(long timeout, TimeUnit unit)
      Sets timeout for receiving a response from the servers. This timeout is not for receiving the entire server response. A server that responds with bytes slowly will not trigger the timeout, unless the specified amount of time has passed between received bytes. A timeout of 0 will disable any read timeouts.
      Parameters:
      timeout - time to wait for a response from the server
      unit - unit of time
      Returns:
      this builder
      Throws:
      IllegalArgumentException - if timeout is negative
      NullPointerException - if unit is null
    • withSslSocketFactory

      public StandardHttpRequestor.Config.Builder withSslSocketFactory(SSLSocketFactory sslSocketFactory)
      Sets a SSLSocketFactory for all connections. Providing your own SSLSocketFactory is optional and can be used to customize SSL configurations (e.g. for certificate pinning).
      Parameters:
      sslSocketFactory - The SSLSocketFactory instance to be used with each HttpsURLConnection.
      Returns:
      this builder
    • build

      Returns a StandardHttpRequestor.Config with the values set by this builder.
      Returns:
      StandardHttpRequestor.Config with this builder's values