URLConnectionOptions (Apache Commons Configuration 2.15.1 API)
Description: declaration: package: org.apache.commons.configuration2.io, class: URLConnectionOptions

Package org.apache.commons.configuration2.io

# Class URLConnectionOptions

java.lang.Object
org.apache.commons.configuration2.io.URLConnectionOptions

public final class URLConnectionOptions extends Object
Carries options and operates on `URLConnection`.

Since:
  2.8.0

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final URLConnectionOptions`
  `DEFAULT`
  Default options.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `URLConnectionOptions()`
  Constructs a new default instance.
  `URLConnectionOptions(URLConnectionOptions urlConnectionOptions)`
  Constructs an instance with values from the given URLConnectionOptions.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `URLConnection`
  `apply(URLConnection urlConnection)`
  Applies the options to the given connection.
  `boolean`
  `equals(Object obj)`
  `boolean`
  `getAllowUserInteraction()`
  Gets whether to allow user interaction.
  `int`
  `getConnectTimeoutMillis()`
  Gets the connect timeout.
  `int`
  `getReadTimeoutMillis()`
  Gets the read timeout.
  `boolean`
  `getUseCaches()`
  Gets whether to cache.
  `int`
  `hashCode()`
  `URLConnection`
  `openConnection(URL url)`
  Opens a connection for the given URL with our options.
  `URLConnectionOptions`
  `setAllowUserInteraction(boolean allowUserInteraction)`
  `URLConnectionOptions`
  `setConnectTimeoutMillis(int connectTimeoutMillis)`
  `URLConnectionOptions`
  `setReadTimeoutMillis(int readTimeoutMillis)`
  `URLConnectionOptions`
  `setUseCaches(boolean useCaches)`
  `String`
  `toString()`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### DEFAULT

    public static final URLConnectionOptions DEFAULT
    Default options.

- ## Constructor Details

  - ### URLConnectionOptions

    public URLConnectionOptions()
    Constructs a new default instance.

  - ### URLConnectionOptions

    public URLConnectionOptions(URLConnectionOptions urlConnectionOptions)
    Constructs an instance with values from the given URLConnectionOptions.
    Parameters:
      `urlConnectionOptions` - the source

- ## Method Details

  - ### apply

    public URLConnection apply(URLConnection urlConnection)
    Applies the options to the given connection.
    Parameters:
      `urlConnection` - the target connection.
    Returns:
      the given connection.

  - ### equals

    public boolean equals(Object obj)
    Overrides:
      `equals` in class `Object`

  - ### getAllowUserInteraction

    public boolean getAllowUserInteraction()
    Gets whether to allow user interaction.
    Returns:
      whether to allow user interaction.

  - ### getConnectTimeoutMillis

    public int getConnectTimeoutMillis()
    Gets the connect timeout.
    Returns:
      the connect timeout.

  - ### getReadTimeoutMillis

    public int getReadTimeoutMillis()
    Gets the read timeout.
    Returns:
      the read timeout.

  - ### getUseCaches

    public boolean getUseCaches()
    Gets whether to cache.
    Returns:
      Whether to cache.

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### openConnection

    public URLConnection openConnection(URL url) throws IOException
    Opens a connection for the given URL with our options.
    Parameters:
      `url` - the URL to open
    Returns:
      A new connection
    Throws:
      `IOException` - if an I/O exception occurs.

  - ### setAllowUserInteraction

    public URLConnectionOptions setAllowUserInteraction(boolean allowUserInteraction)

  - ### setConnectTimeoutMillis

    public URLConnectionOptions setConnectTimeoutMillis(int connectTimeoutMillis)

  - ### setReadTimeoutMillis

    public URLConnectionOptions setReadTimeoutMillis(int readTimeoutMillis)

  - ### setUseCaches

    public URLConnectionOptions setUseCaches(boolean useCaches)

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`