Class URLConnectionOptions
java.lang.Object
org.apache.commons.configuration2.io.URLConnectionOptions
Carries options and operates on
URLConnection
.- Since:
- 2.8.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
TODOprivate int
TODOstatic final URLConnectionOptions
Default options.private int
TODOprivate boolean
TODO -
Constructor Summary
ConstructorsConstructorDescriptionConstructs 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. -
allowUserInteraction
private boolean allowUserInteractionTODO -
connectTimeoutMillis
private int connectTimeoutMillisTODO -
readTimeoutMillis
private int readTimeoutMillisTODO -
useCaches
private boolean useCachesTODO
-
-
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
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()Whether to cache.- Returns:
- Whether to cache.
-
hashCode
public int 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
-