Package org.openstack4j.core.transport
Class HttpEntityHandler
- java.lang.Object
-
- org.openstack4j.core.transport.HttpEntityHandler
-
public class HttpEntityHandler extends Object
Handles retrieving an Entity from an HttpResponse while validating resulting status codes.- Author:
- Jeremy Unruh
-
-
Constructor Summary
Constructors Constructor Description HttpEntityHandler()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcloseQuietly(HttpResponse response)Closes an HttpResponse ignoring a possible IOExceptionstatic <T> Thandle(HttpResponse response, Class<T> returnType, ExecutionOptions<T> options)static <T> Thandle(HttpResponse response, Class<T> returnType, ExecutionOptions<T> options, boolean requiresVoidBodyHandling)static intstatusAndClose(HttpResponse response)Returns the status code and closes the response
-
-
-
Method Detail
-
handle
public static <T> T handle(HttpResponse response, Class<T> returnType, ExecutionOptions<T> options)
-
handle
public static <T> T handle(HttpResponse response, Class<T> returnType, ExecutionOptions<T> options, boolean requiresVoidBodyHandling)
-
closeQuietly
public static void closeQuietly(HttpResponse response)
Closes an HttpResponse ignoring a possible IOException- Parameters:
response- the http response
-
statusAndClose
public static int statusAndClose(HttpResponse response)
Returns the status code and closes the response- Parameters:
response- the http response- Returns:
- the status code
-
-