Class CloudcraftResponse

java.lang.Object
co.cloudcraft.model.CloudcraftResponse

public class CloudcraftResponse extends Object
  • Constructor Details

  • Method Details

    • getResponseAsString

      public String getResponseAsString() throws CloudcraftException
      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

      public com.google.gson.JsonObject getResponseAsJson() throws CloudcraftException
      Parse and return the response as a JSON.
      Returns:
      response content as JsonObject.
      Throws:
      CloudcraftException - when any error occurs exercising this API
    • getResponseAsBytes

      public byte[] getResponseAsBytes() throws IOException
      Parse and return response as byte[].
      Returns:
      response content as byte[].
      Throws:
      IOException
    • getStatusCode

      public Integer getStatusCode()
      HTTP response code
    • getResponseBody

      public InputStream getResponseBody()
      Response content InputStream
    • getContentType

      public String getContentType()
      Content type of the response
    • getETag

      public String getETag()
      HTTP ETag header, if any, returned in the response
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object