Package co.cloudcraft.model
Class CloudcraftResponse
java.lang.Object
co.cloudcraft.model.CloudcraftResponse
-
Constructor Summary
ConstructorsConstructorDescriptionCloudcraftResponse(Integer statusCode, InputStream responseBody, String contentType, String eTag) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanContent type of the responsegetETag()HTTP ETag header, if any, returned in the responsebyte[]Parse and return response as byte[].com.google.gson.JsonObjectParse and return the response as a JSON.Parse and return the response as a String.Response content InputStreamHTTP response codeinthashCode()toString()
-
Constructor Details
-
CloudcraftResponse
public CloudcraftResponse(Integer statusCode, InputStream responseBody, String contentType, String eTag)
-
-
Method Details
-
getResponseAsString
Parse and return the response as a String. Response can be converted to String if the content-type is one of 1. application/json 2. application/xml 3. image/svg+xml 4. text/csv- Returns:
- response content as String.
- Throws:
CloudcraftException- when any error occurs exercising this API
-
getResponseAsJson
Parse and return the response as a JSON.- Returns:
- response content as JsonObject.
- Throws:
CloudcraftException- when any error occurs exercising this API
-
getResponseAsBytes
Parse and return response as byte[].- Returns:
- response content as byte[].
- Throws:
IOException
-
getStatusCode
HTTP response code -
getResponseBody
Response content InputStream -
getContentType
Content type of the response -
getETag
HTTP ETag header, if any, returned in the response -
toString
-
equals
-
canEqual
-
hashCode
public int hashCode()
-