Class PlainHttpUrlConnectionExecutor
java.lang.Object
org.dmfs.httpessentials.httpurlconnection.PlainHttpUrlConnectionExecutor
- All Implemented Interfaces:
org.dmfs.httpessentials.client.HttpRequestExecutor
public final class PlainHttpUrlConnectionExecutor
extends Object
implements org.dmfs.httpessentials.client.HttpRequestExecutor
An
HttpRequestExecutor that's based on Java's HttpUrlConnection.
Note that this implementation is constrained by the underlying HttpURLConnection implementation. In particular that means you should not rely on
being able to use certain HTTP methods like PROPFIND. Standard HTTP methods should always work though.
Also note that this, by convention, won't follow redirects.
-
Constructor Summary
ConstructorsConstructorDescriptionCreates anPlainHttpUrlConnectionExecutorusing aFiniteDefaultHttpUrlConnectionFactorywith default timeouts.PlainHttpUrlConnectionExecutor(HttpUrlConnectionFactory connectionFactory) Creates anPlainHttpUrlConnectionExecutorthat uses the givenHttpUrlConnectionFactory. -
Method Summary
-
Constructor Details
-
PlainHttpUrlConnectionExecutor
public PlainHttpUrlConnectionExecutor()Creates anPlainHttpUrlConnectionExecutorusing aFiniteDefaultHttpUrlConnectionFactorywith default timeouts. -
PlainHttpUrlConnectionExecutor
Creates anPlainHttpUrlConnectionExecutorthat uses the givenHttpUrlConnectionFactory.- Parameters:
connectionFactory-
-
-
Method Details
-
execute
public <T> T execute(URI uri, org.dmfs.httpessentials.client.HttpRequest<T> request) throws IOException, org.dmfs.httpessentials.exceptions.ProtocolError, org.dmfs.httpessentials.exceptions.ProtocolException - Specified by:
executein interfaceorg.dmfs.httpessentials.client.HttpRequestExecutor- Throws:
IOExceptionorg.dmfs.httpessentials.exceptions.ProtocolErrororg.dmfs.httpessentials.exceptions.ProtocolException
-