Package org.openstack4j.core.transport
Interface HttpResponse
-
- All Superinterfaces:
AutoCloseable,Closeable
public interface HttpResponse extends Closeable
Wraps a Response from the Jersey Client- Author:
- Jeremy Unruh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetContentType()The current content-type within the response<T> TgetEntity(Class<T> returnType)Gets the entity and Maps any errors which will result in a ResponseException<T> TgetEntity(Class<T> returnType, ExecutionOptions<T> options)Gets the entity and Maps any errors which will result in a ResponseExceptionInputStreamgetInputStream()intgetStatus()Gets the status from the previous RequestStringgetStatusMessage()The status message which is associated with the currentgetStatus()Stringheader(String name)Returns a Header value from the specified name keyMap<String,String>headers()<T> TreadEntity(Class<T> typeToReadAs)Reads the entity as is into the specified type without any exception mapping
-
-
-
Method Detail
-
getEntity
<T> T getEntity(Class<T> returnType)
Gets the entity and Maps any errors which will result in a ResponseException- Type Parameters:
T- the generic type- Parameters:
returnType- the return type- Returns:
- the entity
-
getEntity
<T> T getEntity(Class<T> returnType, ExecutionOptions<T> options)
Gets the entity and Maps any errors which will result in a ResponseException- Type Parameters:
T- the generic type- Parameters:
returnType- the return typeoptions- execution options- Returns:
- the entity
-
readEntity
<T> T readEntity(Class<T> typeToReadAs)
Reads the entity as is into the specified type without any exception mapping- Parameters:
typeToReadAs- the type to read the desired entity in as- Returns:
- the entity
-
getStatus
int getStatus()
Gets the status from the previous Request- Returns:
- the status code
-
getContentType
String getContentType()
The current content-type within the response- Returns:
- the response content-type
-
getStatusMessage
String getStatusMessage()
The status message which is associated with the currentgetStatus()- Returns:
- the status message or null
-
getInputStream
InputStream getInputStream()
- Returns:
- the input stream
-
header
String header(String name)
Returns a Header value from the specified name key- Parameters:
name- the name of the header to query for- Returns:
- the header as a String or null if not found
-
-