Class URLConnectionOptions
java.lang.Object
org.apache.commons.configuration2.io.URLConnectionOptions
Carries options and operates on
URLConnection
.- Since:
- 2.8.0
-
Field Summary
-
Constructor Summary
ConstructorDescriptionConstructs a new default instance.URLConnectionOptions
(URLConnectionOptions urlConnectionOptions) Constructs an instance with values from the given URLConnectionOptions. -
Method Summary
Modifier and TypeMethodDescriptionapply
(URLConnection urlConnection) Applies the options to the given connection.boolean
boolean
Gets whether to allow user interaction.int
Gets the connect timeout.int
Gets the read timeout.boolean
Whether to cache.int
hashCode()
openConnection
(URL url) Opens a connection for the given URL with our options.setAllowUserInteraction
(boolean allowUserInteraction) setConnectTimeoutMillis
(int connectTimeoutMillis) setReadTimeoutMillis
(int readTimeoutMillis) setUseCaches
(boolean useCaches) toString()
-
Field Details
-
DEFAULT
Default options.
-
-
Constructor Details
-
URLConnectionOptions
public URLConnectionOptions()Constructs a new default instance. -
URLConnectionOptions
Constructs an instance with values from the given URLConnectionOptions.- Parameters:
urlConnectionOptions
- the source
-
-
Method Details
-
apply
Applies the options to the given connection.- Parameters:
urlConnection
- the target connection.- Returns:
- the given connection.
-
equals
-
getAllowUserInteraction
Gets whether to allow user interaction.- Returns:
- whether to allow user interaction.
-
getConnectTimeoutMillis
Gets the connect timeout.- Returns:
- the connect timeout.
-
getReadTimeoutMillis
Gets the read timeout.- Returns:
- the read timeout.
-
getUseCaches
Whether to cache.- Returns:
- Whether to cache.
-
hashCode
-
openConnection
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
-
setConnectTimeoutMillis
-
setReadTimeoutMillis
-
setUseCaches
-
toString
-